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 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 t

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 2

[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 ma