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

Written By
February 28, 2010 08:51AM
Re: How to get rid of 'filesort'?
March 01, 2010 04:51PM
March 01, 2010 11:27PM
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.