MySQL Forums
Forum List  »  Optimizer & Parser

ORDER BY ... LIMIT
Posted by: Ed Mazur
Date: September 27, 2007 11:24AM

Hi all,

I'm having some trouble optimizing a SELECT statement that uses ORDER BY ... LIMIT:

EXPLAIN
SELECT *
FROM bots_levels
ORDER BY date DESC
LIMIT 200;

I created an index on the date column, but this query still ends up going through all ~140,000 rows. I browsed through the documentation and looked at a tutorial on optimizing ORDER BY ... LIMIT queries, but both were to no avail.

Ed

Options: ReplyQuote


Subject
Views
Written By
Posted
ORDER BY ... LIMIT
3857
September 27, 2007 11:24AM
2462
September 27, 2007 05:07PM


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.