MySQL Note

分区

官方文档:https://dev.mysql.com/doc/refman/8.0/en/partitioning.html

分区类型

  • Range
  • List
  • Columns
    • Range
    • List
  • Hash
    • Linear
  • Key
    • Linear Key

分区名大小写不敏感

Subpartition

SUBPARTITION BY KEY不支持默认值(异于PARTITION BY KEY);每个partition中拥有的subpartition必须一样。

对NULL的处理

range落在最低;list落在指定了null值的partition,否则报错;hash及key中落在0 partition。

分区键,主键,唯一键

官方文档总结就是:All columns used in the partitioning expression for a partitioned table must be part of every unique key that the table may have.

官网给出的示例:https://dev.mysql.com/doc/refman/8.0/en/partitioning-limitations-partitioning-keys-unique-keys.html

原文地址:https://www.cnblogs.com/cheungchein/p/10040895.html