Hi Ken -- > Sqlite is using the fact that You have an order by clause on both statements. > Removing the order by clears this up.... > > the first query sqlite is not able to use and index and must full scan the > table. It then uses the fact that an order by is used on column B. Thus it > accesses idx_b! (which is correct). > > the second query sqlite decides to use the index on idx_A and thats how it > performs its access. The order by is then done internally on the resulting > data!
In the second query, is sqlite unable to determine that idx_a is basically useless by looking at the analyze statistics? Is the best thing to do in this case is simply drop idx_a because it is useless? I think I might wind up doing this, but I worry about the future where column A might have more interesting data in it and would actually benefit from the index. thanks for the help, -steve _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users