On 7 Dec 2019, at 2:26am, Shawn Wagner <shawnw.mob...@gmail.com> wrote:

> The first one uses the index for all sorting, but the second one only uses it 
> for sorting a, not b. I feel like the descending sort could make use of the 
> index too, just reading the b sections backwards to get the right order. Is 
> there something I'm overlooking that would make this sort of optimization 
> impractical or otherwise a bad idea?

Hmm.  Try running ANALYZE and then doing the EXPLAIN QUERY PLAN lines again.

But I think that without 'chunkiness' information (how many values columns a 
and b have) it would not be worth doing the complicated programming required 
for reverse-mini-scanning of that index.  The programming is quite complicated 
and unless your index "b" is chunky it won't save you much time over the plan 
shown.
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to