"Jim Wilcoxson" <pri...@gmail.com> wrote
in message
news:c5830b750905080813p6bf901bn526c81ca8ce7a...@mail.gmail.com
> I don't know if it makes any difference, but is that where clause the
> same as:
>
> WHERE name< 'zUmM' OR (name= 'zUmM' AND S.id< 8122)

SQLite's optimizer cannot use an index for any condition involving OR. 
That's why it's common to write an equivalent but somewhat unnatural

name <= 'zUmM' AND (name< 'zUmM' OR S.id< 8122)

This way, at least the first condition has a chance of being satisfied 
with 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