Re: [sqlite] "cursored" queries and total rows

2018-06-08 Thread Wout Mertens
One more thing: On Sun, Jun 3, 2018 at 2:16 PM R Smith wrote: > > - If it is an Index, /and/ the Key repeats magnificently much (Imagine > adding an "Age" column to a phone-book and then filtering on Age, there > will be thousands of people who are all 34, for instance) then you are > better

Re: [sqlite] "cursored" queries and total rows

2018-06-08 Thread Wout Mertens
Argh, I just discovered that gmail was sending all sqlite mails to spam :( Thank you all for the answers! Clemens, R Smith: Sorry, I should have given a full production query. Here's an example: SELECT "id" AS _3,"json" AS _5,ifNull(json_extract(json, '$.name'),'') AS _0 FROM "agents" tbl

Re: [sqlite] "cursored" queries and total rows

2018-06-04 Thread heribert
I'm using also paged queries. I'm adding an OFFSET to the select-limit query. Works for me. Am 03.06.2018 um 14:16 schrieb R Smith: On 2018/06/03 1:13 PM, Wout Mertens wrote: Hi all, To do paged queries on a query like SELECT colVal FROM t WHERE b=? LIMIT 10 I keep track of column

Re: [sqlite] "cursored" queries and total rows

2018-06-03 Thread R Smith
On 2018/06/03 1:13 PM, Wout Mertens wrote: Hi all, To do paged queries on a query like SELECT colVal FROM t WHERE b=? LIMIT 10 I keep track of column values and construct a query that will get the next item in a query by augmenting the query like SELECT colVal FROM t WHERE b=? AND

Re: [sqlite] "cursored" queries and total rows

2018-06-03 Thread Clemens Ladisch
Wout Mertens wrote: > To do paged queries on a query like > > SELECT colVal FROM t WHERE b=? LIMIT 10 This does not make sense without an ORDER BY. > To know how many rows there are in the query, I do > > SELECT COUNT(*) FROM t WHERE b=? > > Are there any efficiency tricks here? No.

[sqlite] "cursored" queries and total rows

2018-06-03 Thread Wout Mertens
Hi all, To do paged queries on a query like SELECT colVal FROM t WHERE b=? LIMIT 10 I keep track of column values and construct a query that will get the next item in a query by augmenting the query like SELECT colVal FROM t WHERE b=? AND colVal > ? LIMIT 10 To know how many rows