云数据库 GAUSSDB(FOR MYSQL)-KEY-LIST:使用示例

时间:2024-09-11 14:19:51

使用示例

KEY-LIST类型的使用示例

CREATE TABLE tbl_key_list
(
    col1 INT,
    col2 INT,
    col3 varchar(20),
    col4 DATE
)
PARTITION BY KEY(col1)
SUBPARTITION BY LIST(col2)
(
  PARTITION dp0 (
    SUBPARTITION p0 VALUES in (1, 2),
    SUBPARTITION p1 VALUES in (3, 4),
    SUBPARTITION p2 VALUES in (5, 6)
  ),
  PARTITION dp1
  (
    SUBPARTITION p3 VALUES in (1, 2),
    SUBPARTITION p4 VALUES in (3, 4),
    SUBPARTITION p5 VALUES in (5, 6)
  ),
  PARTITION dp2
  (
    SUBPARTITION p6 VALUES in (1, 2),
    SUBPARTITION p7 VALUES in (3, 4),
    SUBPARTITION p8 VALUES in (5, 6)
  )
);
support.huaweicloud.com/kerneldesc-gaussdbformysql/gaussdbformysql_20_0049.html