On 11/30/2013 12:40 PM, Tristan Van Berkom wrote:
However, in a statement formed like the one you proposed
above, it screws with the query optimizer in SQLite I suspect,
i.e. when searching for a prefix on an email address,
SQLite (I suspect) decides to prioritize the UID index instead
of the perfectly good (much better even) index on email_list.value.

You can suppress the use of this index by writing " ON +email_list.uid = summary.uid ". Note the unary plus. It doesn't change the meaning of the expression, but makes it ineligible for participating in an index.
--
Igor Tandetnik

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

Reply via email to