MySQL Forums
Forum List  »  Performance

Indexing: on WHERE columns or ORDER BY columns?
Posted by: Craig Matthews
Date: May 31, 2005 04:58AM

Hi

I have a query as follows:

select * from table1
where col1 = 1 and col2 = 2
order by col 3

My index is on col1, col2

The table is using the index for the where clause, but also using a filesort for the ordering by col3?

What are my options to optimize this? Should I add col3 to the index? Should I increase some buffer for sorting functions?

Appreciate some thoughts.

Options: ReplyQuote


Subject
Views
Written By
Posted
Indexing: on WHERE columns or ORDER BY columns?
2404
May 31, 2005 04:58AM


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.