Randy Paries wrote:
Hello,
I have a table (see below) that has 111599 records in it.
When i do a query like select * from gallery_object where dir = 'dirname'
Use explain to see if it's using the index:
explain select * from ....
it could be that for that particular directory you have a lot of data -
in which case mysql can't use an index because it covers too much of the
table. I think it's roughly 30% that the switch happens (so if the data
you're querying covers more than 30% of the table, the index isn't used).
Check with something like this:
select dir, count(*) as blah from gallery_object group by dir order by
blah desc limit 10;
it will show you how many records each 'dir' has for the top 10.
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]