MySQL Forums
Forum List  »  Performance

Re: Indexing ORDER BY Columns
Posted by: James Day
Date: December 21, 2004 11:36AM

The manual has a section on optimising order by and that may help. So may MySQL 5.0.

For 3.n and 4.n you'd ideally want the index needed for the order by to also be the index best suited to handle the where clause, because you only get one index per table alias. Exploring the use of a self join or different variations in index choice can be useful.

Sometimes you might have a where a=something and order by b situation which can be replaced by where a=something order by a,b to get the same result and make it more obvious that an index on a,b is the right choice.

Options: ReplyQuote


Subject
Views
Written By
Posted
2744
December 20, 2004 08:28PM
Re: Indexing ORDER BY Columns
1961
December 21, 2004 11:36AM
1912
December 27, 2004 03:38PM


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.