MySQL Forums
Forum List  »  Optimizer & Parser

Re: How to get rid of 'filesort'?
Posted by: Rick James
Date: March 01, 2010 04:51PM

See if this will solve it:
INDEX(shop_id, status, product_id)
That gets all the WHERE clauses for p, and they are "=", followed by the field needed for GROUP BY. So, if it decides to start with p, it should avoid the much maligned "filesort".

The real problem is not "filesort" but rather JOINing tables and filtering on fields in more than one of them.

Options: ReplyQuote


Subject
Views
Written By
Posted
3774
February 28, 2010 08:51AM
Re: How to get rid of 'filesort'?
1818
March 01, 2010 04:51PM
1949
March 01, 2010 11:27PM
1622
March 02, 2010 04:56PM


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.