On Apr 20, 2009, at 4:20 PM, [email protected] wrote:

> Hi,
> if I've got a lot of queries as follows:
> SELECT id,title FROM Song WHERE title >= 'last_title' AND
> (title>'last_title' OR id>last_id) ORDER BY title ASC, id ASC
> what's the best index should be created? (id is the key);
> I red that I can only use a multicolumn index if the left condition is
> equal (=), is it true?

   CREATE INDEX i1 ON Song(title, id);

Or leave the "id" bit out if "id" is actually an integer
primary key.

>
> _______________________________________________
> sqlite-users mailing list
> [email protected]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to