MySQL Forums
Forum List  »  Partitioning

Re: Partitioning Limitations
Posted by: Rick James
Date: October 03, 2009 06:03PM

Partitioning is excellent for purging of old data (eg tossing data more than 30 days old).

Partitioning can help in some cases where a full table scan would otherwise be done. It limits the number of rows examined to a subset of the partitions. Still, it has to scan a significant number of rows. A full table scan, or anything approaching it, is a no-no in a production environment; I look for ways to reformulate the query and/or the schema. This rarely leads to partitioning.

Data Warehousing seems like an excellent application for Partitioning. I would argue that creating summary tables is a much better way to get performance out of DW.

Jon, I may sound like a skeptic, but I would actually love to have some examples where Partitioning provides better performance in production environments than other techniques. (The examples in the pruning DevZone pages did not impress me.)

When subqueries were first added to MySQL, I thought all subqueries could be turned into JOINs. Gradually, I learned
* some subqueries cannot be turned into JOINs.
* some subqueries provide better performance.
* MySQL sometimes cannot recognize optimizations that converting to JOIN would achieve.

Meanwhile, when someone quotes "queries on partitioned tables can be significantly faster", I respond with "do you have such queries?" and "can they be optimized other ways?".

The examples on the DevZone and pruning pages seem to center around pruning as a way of shrinking a table scan down to a range scan. I counter with

* Changing indexes (and WHERE) to do similar things in a plain table.

* Clustering the data (eg, as InnoDB does with its PK) can sometimes achieve as good or better results. (I did not notice any mention of clustering the data as a possible benefit of partitioning. I have heard of a benchmark showing a modest improvement from a careful partitioning of a multi-TB table.)

* If you need a long table/range scans have no place in the Web world. (OK, there are a lot of useful applications that don't require low latency.)

Options: ReplyQuote


Subject
Views
Written By
Posted
6279
September 17, 2009 07:50PM
2748
September 18, 2009 11:11PM
2545
September 21, 2009 02:59AM
2694
September 22, 2009 08:28AM
2532
September 27, 2009 10:27PM
2584
September 27, 2009 10:47PM
2747
October 03, 2009 02:43AM
Re: Partitioning Limitations
2751
October 03, 2009 06:03PM


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.