Tuesday, October 27, 2009

A UNIQUE INDEX must include all columns in the table's partitioning function

the partitions rule says all columns in a partition expression must be in all unique keys, in other words every unique key on the table must use every column in the table's partitioning expression.

The same applies for primary keys, otherwise you will get error:
ERROR 1503 (HY000): A PRIMARY KEY must include all columns in the table's partitioning function

The detailed explanation is given at http://dev.mysql.com/doc/refman/5.1/en/partitioning-limitations-partitioning-keys-unique-keys.html

plan partitioning before creating a table, creating partitions in existing table with huge data is very difficult, you might have to alter table to remove all partitions restrictions.

No comments:

Post a Comment