Dominique Devienne wrote: > It's a group-by query, so despite using the index, all rowids for the only > 4 different "index entries" must still be counted, > and that's still definitely longer to do that than full scanning the table > once.
So why using GROUP BY? The top-level query does not really want all groups, it wants to determine individual counts. I estimate that a simple "SELECT count(*) FROM tab WHERE code_type = ?" would be faster. Regards, Clemens _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users