Subscribe to RSS Subscribe to Comments

My So-Called Blog

Partitioning Optimizations

We’ve been getting lots of questions about how MySQL 5.1 optimises queries on partitioned tables. Recently, we added some new information about this to our Internals Manual provided by one of our developers, Sergey Petrunia. (I hope that my edits and formatting haven’t messed up anything — if there are any problems with what’s been published in the Internals Manual, then the fault’s probably mine and not his.)

The new section can be accessed here, and includes coverage of the following topics:

  • An overview of how MySQL performs partition pruning
  • What partitioning and subpartitioning intervals are, and why they’re important
  • Converting WHERE and ON clauses into intervals
  • Partition selection
  • Where to find partition pruning and selection code in the 5.1 sources

Sergey’s included several helpful examples and diagrams as well. Even if you’re not interested in hacking the source, you might find this material useful for understanding better how MySQL Partitioning works “behind the scenes”, so be sure to check it out.

MySQL 5.0.45-communityPHP 5.2.3