主键与分区的关系

小结:

1、唯一键必须包含分区函数中的所有字段;主键是唯一键的一种;

 

A PRIMARY KEY must include all columns in the table's partitioning function

22.6.1 Partitioning Keys, Primary Keys, and Unique Keys

This section discusses the relationship of partitioning keys with 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. This particular case is discussed later in this section.) 

https://dev.mysql.com/doc/refman/8.0/en/partitioning-limitations-partitioning-keys-unique-keys.html

 

posted @ 2019-03-21 10:57  papering  阅读(921)  评论(0编辑  收藏  举报