Alexey Pechnikov wrote: > > I think, you can use index directly as > create index id_idx on mytable(id); > > select count(id) from mytable where id>0; > > explain query plan select count(id) from mytable where id>0; > 0|0|TABLE mytable WITH INDEX id_idx > > It's better than use count(*) with "where" condition.
I can't see how this improves the situation any. You are making SQLite do a full scan of the index (assuming all records have an id > 0) instead of a full scan of the table. It still has to count each record. Dennis Cote _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users