MySQL Forums
Forum List  »  Performance

multi-part index and when it is used?
Posted by: Peter Halliday
Date: January 12, 2005 05:05PM

Say I have a phonebook table that has a multi-part index on lastname, firstname, middleInitial. If I do SELECT * FROM phonebook WHERE lastName = 'Smith', then it should use the index right? What if I do SELECT * FROM phonebook WHERE lastName LIKE 'S%' would that use the index also? If I wanted to list the whole phonebook would SELECT * FROM phonebook use the correct index if I had multiple indexes?

THe idea behind this is I heard that trying to remove ORDER BY by using indexes helps on RAM and can speed a query up potentially. Therefore, I was thinking of how to do this in scenarios like the the one give where there are some WHEREs, but not all.

Peter

Options: ReplyQuote


Subject
Views
Written By
Posted
multi-part index and when it is used?
4691
January 12, 2005 05: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.