MySQL Forums
Forum List  »  Partitioning

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


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

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,

Options: ReplyQuote

Written By
Range partition ordering for ORDER BY LIMIT queries
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.