Re: [sqlite] Find the user in the sorted table and retrieve a certain number of users above and below him

2019-02-14 Thread Dobrila
I did try to do something with rank() and row_number() but it slowed the query a lot bringing it up to 26 ms. > On 14 Feb 2019, at 16:33, Shawn Wagner wrote: > > Are you using a new enough version of sqlite (3.25 or better) that you can > use window functions? > >> On Thu, Feb 14, 2019, 7:29

Re: [sqlite] Tips for index creation.

2019-02-14 Thread Simon Slavin
On 14 Feb 2019, at 6:06pm, Randall Smith wrote: > One feature that would be useful for the sqlite3 command shell would be a > mode where the duration of the operation is reported after the operation runs > (".timing"?). .timer ON Simon. ___

Re: [sqlite] Tips for index creation.

2019-02-14 Thread Randall Smith
One feature that would be useful for the sqlite3 command shell would be a mode where the duration of the operation is reported after the operation runs (".timing"?). This would make it easy to compare different approaches for writing a query, formulating and using different indices, etc. Of

Re: [sqlite] Global UDF using sqlite3_create_function()?

2019-02-14 Thread Arun - Siara Logics (cc)
I think this is a good option. Looks like I can save from registering UDFs everytime a connection is created. Thanks!! On Thu, 14 Feb 2019 18:59:09 +0530 Keith Medcalf wrote > > See also SQLITE_EXTRA_INIT > > > --- > The fact that there's a Highway to Hell but only a

Re: [sqlite] Find the user in the sorted table and retrieve a certain number of users above and below him

2019-02-14 Thread Dobrila Šunde
Yes, sqlite 3.26. On Thu, Feb 14, 2019 at 4:33 PM Shawn Wagner wrote: > Are you using a new enough version of sqlite (3.25 or better) that you can > use window functions? > > On Thu, Feb 14, 2019, 7:29 AM Dobrila Šunde wrote: > > > Hi! > > > > So I have been trying to write a query that needs

Re: [sqlite] Find the user in the sorted table and retrieve a certain number of users above and below him

2019-02-14 Thread Shawn Wagner
Are you using a new enough version of sqlite (3.25 or better) that you can use window functions? On Thu, Feb 14, 2019, 7:29 AM Dobrila Šunde Hi! > > So I have been trying to write a query that needs to be really fast (under > 1 ms would be ideal) to a very large database (around 20 000 rows and

[sqlite] Find the user in the sorted table and retrieve a certain number of users above and below him

2019-02-14 Thread Dobrila Šunde
Hi! So I have been trying to write a query that needs to be really fast (under 1 ms would be ideal) to a very large database (around 20 000 rows and 20 columns). The problem is that I need to find the user inside the sorted database and retrieve a number of users better and worse than him as to

Re: [sqlite] Global UDF using sqlite3_create_function()?

2019-02-14 Thread Keith Medcalf
See also SQLITE_EXTRA_INIT --- The fact that there's a Highway to Hell but only a Stairway to Heaven says a lot about anticipated traffic volume. >-Original Message- >From: sqlite-users [mailto:sqlite-users- >boun...@mailinglists.sqlite.org] On Behalf Of Arun - Siara Logics >(cc)

Re: [sqlite] Global UDF using sqlite3_create_function()?

2019-02-14 Thread Arun - Siara Logics (cc)
Thank you!! It works like a charm. Before your reply I added FUNCTION macros before sqlite3InsertBuiltinFuncs(). That worked too. But I guess using sqlite3_auto_extension() is elegant and I will go that way. On Thu, 14 Feb 2019 17:16:01 +0530 Richard Hipp wrote > On 2/14/19,

Re: [sqlite] Global UDF using sqlite3_create_function()?

2019-02-14 Thread Richard Hipp
On 2/14/19, Arun - Siara Logics (cc) wrote: > > The sqlite3_create_functions require the 'db' parameter to define a user > defined function according to the doc: > "The first parameter is the database connection to which the SQL function is > to be added. If an application uses more than one

[sqlite] Window functions in System.Data.Sqlite

2019-02-14 Thread Alexandre Billon
Hello, I am sorry in advance for this post but I am really looking forward having the window functions in System.Data.Sqlite. The expected release date went from December 2018 to February 2019 in the news page. Do you have any more info when will the new version of System.Data.Sqlite be

[sqlite] Global UDF using sqlite3_create_function()?

2019-02-14 Thread Arun - Siara Logics (cc)
Hi, The sqlite3_create_functions require the 'db' parameter to define a user defined function according to the doc: "The first parameter is the database connection to which the SQL function is to be added. If an application uses more than one database connection then application-defined SQL