Click to See Complete Forum and Search --> : Why tb1.Name=tb2.Name does not use index on Name


cy163
November 4th, 2008, 09:49 AM
Hello ALL,

I did the following query. the EXPLAIN result showed 'NULL' in the 'key' colume, meaning that NONE of indexes have been used. However, indexes have been created on Name fields for both tb1 and tb2. I wonder why MySQL does not use the indexes to speed up the query. Is there any way to make the query faster?



EXPLAIN SELECT
tb1.Name
FROM
tb1, tb2
WHERE
tb1.Name = tb2.Name;

cjard
November 5th, 2008, 08:27 AM
If you were going to read a whole book anyway, what would be the point in looking in the index to see a list of all the words the book contains?


Is there any way to make the query faster?

How about a where clause?