|
-
November 4th, 2008, 10:49 AM
#1
Why tb1.Name=tb2.Name does not use index on Name
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?
Code:
EXPLAIN SELECT
tb1.Name
FROM
tb1, tb2
WHERE
tb1.Name = tb2.Name;
-
November 5th, 2008, 09:27 AM
#2
Re: Why tb1.Name=tb2.Name does not use index on Name
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?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|