Re: multi-part index and when it is used?
Hi,
"SELECT * FROM phonebook ORDER BY lastName, firstName, middleInitial" normally wouldn't use the index. The only time it would is if the * represents only the columns lastName, firstName, middleInitial (ie. there are only 3 columns in the entire table). I discussed that logic at
http://forums.mysql.com/read.php?24,10738,10785#msg-10785
A covering index is when all columns in the query are part of the same index. Then MySQL won't have to read the datafile at all. Since you are retreiving all of the rows above, it won't use the index to do it unless there is a covering index.
Harrison Fisk, Trainer and Consultant
MySQL AB, www.mysql.com
Subject
Views
Written By
Posted
4929
January 12, 2005 05:05PM
2834
January 12, 2005 09:21PM
2088
January 13, 2005 07:18AM
Re: multi-part index and when it is used?
2216
January 13, 2005 07:36AM
2032
January 13, 2005 07:39AM
2085
January 14, 2005 01:29AM
2257
January 14, 2005 10:03AM
2143
January 14, 2005 04:05PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.