MySQL Forums
Forum List  »  Optimizer & Parser

Re: How to optimize an ORDER BY query using a range to avoid any filesorts
Posted by: KimSeong Loh
Date: October 24, 2007 04:35PM

Your observation is correct.

You can have one of the two, if your table is really big and the number rows that got selected is small, then filesort is a better option than a full index scan.
However, if the number of rows selected is large as compared to the total nubmer of rows, then the full index scan without filesort could be better.

So, chose according to your usage.



Edited 1 time(s). Last edit at 10/24/2007 04:35PM by KimSeong Loh.

Options: ReplyQuote




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.