云数据库 GAUSSDB-CREATE TABLE PARTITION | SUBPARTITION AS:语法格式

时间:2024-12-13 17:15:46

语法格式

  • 使用CREATE TABLE PARTITION AS创建一级分区表,并填充子查询数据:
    CREATE  TABLE [ IF NOT EXISTS ] partition_table_name
        [ (column_name [, ...] ) ]
        [ { ENGINE [ = ] { InnoDB | 'InnoDB' | "InnoDB" } } [ [ , ] ... ] ]
        [ WITH ( {storage_parameter = value} [, ... ] ) ]
        [ ILM ADD POLICY ROW STORE COMPRESS ADVANCED ROW AFTER n { day | month | year } OF NO MODIFICATION [ ON ( EXPR )]]
        [ TABLESPACE tablespace_name ]
         PARTITION BY partition_clause partition_definition_list
        AS query
        [ WITH [ NO ] DATA ];
  • 使用CREATE TABLE SUBPARTITION AS创建二级分区表,并填充子查询数据:
    CREATE  TABLE [ IF NOT EXISTS ] partition_table_name
        [ (column_name [, ...] ) ]
        [ { ENGINE [ = ] { InnoDB | 'InnoDB' | "InnoDB" } } [ [ , ] ... ] ]
        [ WITH ( {storage_parameter = value} [, ... ] ) ]
        [ ILM ADD POLICY ROW STORE COMPRESS ADVANCED ROW AFTER n { day | month | year } OF NO MODIFICATION [ ON ( EXPR )]]
        [ TABLESPACE tablespace_name ]
         PARTITION BY partition_clause
         SUBPARTITION BY subpartition_clause
         partition_subpartition_definition_list
        AS query
        [ WITH [ NO ] DATA ];

各个字段详细信息请参见语法格式

support.huaweicloud.com/centralized-devg-v8-gaussdb/gaussdb-42-1690.html