MySQL Forums
Forum List  »  Partitioning

Range partition ordering for ORDER BY LIMIT queries
Posted by: Nikos Sarkas
Date: January 27, 2011 05:21PM

Hello,

Suppose that I perform range partition on a column `date'. Consider now a query

SELECT *
FROM table
WHERE date<=20110127 ORDER BY date DESC LIMIT 1

A possible optimization in this case would be to consider the matching partitions in descending order of date upper bounds and stop early. Does this optimization happen? Does it depend on whether `date' is part of the primary key? If the optimization doesn't happen, is there a well defined order that the partitions will be considered (i.e., lexicographically)?

Thank you,
Nikos

Options: ReplyQuote


Subject
Views
Written By
Posted
Range partition ordering for ORDER BY LIMIT queries
4298
January 27, 2011 05:21PM


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.