MySQL Forums
Forum List  »  Optimizer & Parser

Re: How to optimise a query to avoid filesort on LARGE resultset
Posted by: Faury Rodriguez
Date: November 26, 2007 03:36PM

The issue is the optimizer isn't using the whenadded key that has your results in order.

If you were to create an index with kioskid and then whenadded in DESC order, this should eliminate the filesort.

So...
CREATE INDEX kioskid_whenadded ON LogAllEvents (kioskid, whenadded DESC)

should do it.

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: How to optimise a query to avoid filesort on LARGE resultset
4467
November 26, 2007 03:36PM


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.