On Dec 10, 2008, at 7:48 AM, Igor Tandetnik wrote: > >> I have seen that sqlite cannot use more than one index >> at a time, so I was wondering if the second option is >> always the best solution. > > Not always. If you have a single index on (X, Y, Z), it can't be used > for queries like > > select * from mytable where Y=?; > select * from mytable where Z=?; > > for the same reason that the sort order in a dictionary doesn't help > you > find all words whose second letter is 'a'.
Excellent analogy, Igor! I should work that into the SQLite documentation somehow. D. Richard Hipp [EMAIL PROTECTED] _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users