On Jan 7, 2010, at 8:18 AM, Tim Romano wrote:

> I don't claim any SQLite expertise, but indexes on values like
> True/False, Male/Female -- i.e. where there are only a couple or a few
> different values possible in the column --   are normally to be  
> avoided
> because low-cardinality indexes tend to be inefficient.  What is the
> advice of the SQLite gurus in this respect?


This is good advice.

If you run ANALYZE, SQLite will figure out that the index is mostly  
useless and will hardly ever use it.  (There are some obscure queries  
for which such an index would be useful, but they are the exception  
rather than the rule.)  On the other hand, SQLite still has to  
maintain the index on INSERT, UPDATE, and DELETE operations which will  
slow those operations down.

D. Richard Hipp
d...@hwaci.com



_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to