> it has something to do with: Cardinality
> see:http://dev.mysql.com/doc/refman/5.0/en/show-index.html
>
> you probably have a 'low' value on this...
I do indeed have a low value on this. Thanks for the link, it says:
"The higher the cardinality, the greater the chance that MySQL uses
the index when doing joins."
This implies that mySQL uses some heuristic to determine when to use
an index. So, if I have a table where one column has a few unique
values, and another has a lot of unique values, and both are indexed,
the table with few unique values will take longer to do a query on
(doing a simple query involving only that column). This seems
counterintuitive. Is this because there is some overhead associated
with using the index, and searching through lots of rows is cheaper?
Thanks for your help.
Dino