Reputation: 42798
Ok guys, just starting out with partitioning some tables in mySQL. There's a couple of different ways describing this, but what I cant find is a more practical approach. - Which type of data does each way of partitioning have the best effect on?
Or doesn't it really matter?
Reference: http://dev.mysql.com/tech-resources/articles/performance-partitioning.html
Upvotes: 1
Views: 8978
Reputation: 91
Let me share with you this great post about time/date based partitioning and subpartitioning with huge data flows. It demonstrates how partitioning can be a good solution for scalable architectures.
Upvotes: 3
Reputation: 63616
It depends exactly what kind of performance problem you're having.
MySQL 5.1's partitioning only allows you to partition the first bit of the primary key. This means that if you want to use any useful form of partitioning, it is often desirable to have a composite primary key.
One of the most common use-cases is for expiring old data, which can be very expensive in non-partitioned cases. In that case you'd have to make the primary key start with a date/time and partition on that.
Then you can expire rows by programmatically dropping old partitions.
Other cases are where your common queries are able to benefit from partition pruning.
Remember that you cannot fix every performance problem with partitioning; it is not magic. For queries which don't benefit from partition pruning, every partition must be queried. MySQL does not do this in parallel, so it is typically as slow as using a non-paritioned table.
Upvotes: 5