One more thing:

On Sun, Jun 3, 2018 at 2:16 PM R Smith <ryansmit...@gmail.com> 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 off extracting the set of records to a TEMP table and then
> paginating through the temp table's complete dataset and COUNT(*) its
> rows. This will be extremely fast, especially if the DB is otherwise
> quite hefty, and will allow using the new table's rowids (invisible in
> the query) as pagination pegs. Be sure to use a memory-oriented journal
> mode and cache settings for this, or if not possible, perhaps even a
> second attached in-memory or memory-oriented DB.


I'd be worried about memory usage, and also having to keep the temp table
between queries until it's no longer needed… I can't predict when the
client is no longer interested in the query. If the query would match 100k
records, won't they all be copied?
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to