MySQL Forums
Forum List  »  Docs

Re: index(column1,column2)
Posted by: Thomas CORBIERE
Date: August 20, 2007 12:54AM

Hello,

This syntax allows you to create a covering index.
It is usefull if you are using both columns in a WHERE clause :

SELECT * FROM t WHERE column1=10 AND column2=5

An extra feature is that with the following index : INDEX(c1,c2,c3)
MySQL acts as if there was three indexes :
- INDEX(c1)
- INDEX(c1,c2)
- INDEX(c1,c2,c3)

That is you can use the leftmost columns in your seach condition.

Regards,

Thomas CORBIERE

Options: ReplyQuote


Subject
Views
Written By
Posted
4671
August 03, 2007 02:43AM
Re: index(column1,column2)
3884
August 20, 2007 12:54AM


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.