On Fri, 2005-06-03 at 13:20 +0200, Jakub Adamek wrote: > Hello, please, is there any way to make SQLite use an index on two > columns when I want to select all rows which have some combination of > the two columns? > > SELECT * FROM PointFeature WHERE > DsetId=203 AND SectId IN (4,400); >
SQLite does use multiple columns of a multi-column index for == constraints. But for an IN operator, it will only using a single column. This is something that I need to work on. In the meantime, I suggest the following work-around: SELECT * FROM PointFeature WHERE DsetId=203 AND SectId=4 UNION ALL SELECT * FROM PointFeature WHERE DsetId=203 AND SectId=400; -- D. Richard Hipp <[EMAIL PROTECTED]>