On 13 Dec 2016, at 4:02pm, Paul Egli <e...@sourcegear.com> wrote:

> Great. Just to clarify, SQLite will already use "alternateChildIndex1" from
> the example? Or just that it would be possible as an enhancement request?

I don’t know the answer, but you can find out exactly what SQLite has chosen to 
do for your case.  Prefix your SELECT command with EXPLAIN QUERY PLAN:

<https://www.sqlite.org/eqp.html>

It’s probably easiest to do this using the SQLite command-line tool.  The plan 
you get back will describe which indexes SQLite has decided to use, or whether 
it couldn’t find a useful index and had to scan the table instead.

Note that using ANALYZE after you have created your indexes can cause a 
dramatic improvement in the options SQLite picks when constructing query plans. 
 If you are in a position of worrying about optimization it’s useful to 
understand ANALYZE and EXPLAIN QUERY PLAN.

Simon.
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to