Re: [sqlite] SQLite does not use opportunity to optimise COUNT() queries using partial indexes

2016-12-01 Thread Paul
Thanks! That explains a lot. For some reason I thought that 'SELECT COUNT() FROM ' is optimised. > Gonna take a stab and answering this. > http://www.sqlite.org/opcode.html > > The explain output for select count() from foo; uses the "Count" opcode. The > description for that is > "Store

Re: [sqlite] SQLite does not use opportunity to optimise COUNT() queries using partial indexes

2016-12-01 Thread David Raymond
Behalf Of Paul Sent: Thursday, December 01, 2016 2:22 AM To: General Discussion of SQLite Database Subject: [sqlite] SQLite does not use opportunity to optimise COUNT() queries using partial indexes I am not very familiar with the SQLite internals, but I believe that index structure is simila

[sqlite] SQLite does not use opportunity to optimise COUNT() queries using partial indexes

2016-11-30 Thread Paul
I am not very familiar with the SQLite internals, but I believe that index structure is similar to that of a table, ie it's a B-TREE with a root containing a node count value. If so, then queries like SELECT COUNT() FROM FOO WHERE <...>; can be optimised the same way that queries like SELECT