MySQL Forums
Forum List  »  Optimizer & Parser

Creating an index to include ORDER BY
Posted by: Angus
Date: November 02, 2006 08:28AM

I have a query which at it's most complex looks like this:

SELECT * FROM t1 WHERE DateColumn<NOW() AND NumberColumn>=const1 AND NumberColumn<=const2 ORDER BY DateColumn,ThePrimaryKeyColumn

Sometimes either or both of the NumberColumn expressions in the WHERE are missing, but the DateColumn and ORDER BY are always there. What index do you recommend? Is there an index that I can create which would include the ORDER BY?

Options: ReplyQuote


Subject
Views
Written By
Posted
Creating an index to include ORDER BY
3123
November 02, 2006 08:28AM
2051
November 03, 2006 09:24AM


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.