On Wed, 7 Feb 2018 09:17:27 +0000
Hick Gunter <h...@scigames.at> escribió:

> SQLite can only use a covering index whose prefix satifies the WHERE and/or 
> ORDER BY clause(es).
> 
> WHERE x=1
> ORDER BY y
> 
> The WHERE constraint can be handled by an index that starts off with x.
> The ORDER BY can be handled by an index that starts off with y.
> 
> SQLite *may* realise that an index on (x,y) satisfies both conditions (within 
> the fixed x values, y values are already ordered). In that case you would 
> require the _id field to make it a convering index (x,y,_id).
> 

_id field is always appened at the end of all indexes, it's integer primary
key. Your index internally will be (x, y, _id, _id)


-- 
Eduardo <eduardo.mor...@mobelservices.com>
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to