具体见手册的21.5.1. Partitioning Keys, Primary Keys, and Unique Keys一节 原句是 The rule governing this relationship can be expressed as follows: All columns used in the partitioning expression for a partitioned table must be part of every unique key that the table may have. In other words, every unique key on the table must use every column in the table's partitioning expression. (This also includes the table's primary key, since it is by definition a unique key.)
可以分区的!!
我的表里面也有UNIQUE索引,我就在这个索引字段上建立的分区。确实是可以分区的。
如果你不能的话,看看你的引擎是INnoDB的?如果是,就这样处理:
先建立表和分区,最后,等分完区后再用
ALTER TABL tableName ADD UNIQUE INDEX idx_unique (唯一索引的字段).这样是可以建立了吧!!
其他字段, 非UNIQUE的索引就OK.
所以偶在装了5.1几天就又换回5.0.
5.0是没有分区功能的。 ??
你不会是分区字段是unique的吧。没出现过如此问题,啥分区,List,Range or Hash ?
原句是
The rule governing this relationship
can be expressed as follows: All columns used in the partitioning expression for a partitioned table must be part of every unique
key that the table may have.
In other words, every unique key on the table must use every column in the table's partitioning expression. (This also includes the
table's primary key, since it is by definition a unique key.)