create table CH_SRV_FEEDBACK
(
SURVEYID VARCHAR(32) not null,
ITEMID VARCHAR(32) not null,
OPERID VARCHAR(32) not null,
OPTIONID VARCHAR(2) default '0' not null,
REGION int8 not null,
ANSWER VARCHAR(1024),
CREATETIME DATE not null
) partition by list (REGION);
create table PART_310 partition of CH_SRV_FEEDBACK for values in (310) partition by range (CREATETIME);
create table PART_311 partition of CH_SRV_FEEDBACK for values in (311) partition by range (CREATETIME);
create table PART_312 partition of CH_SRV_FEEDBACK for values in (312) partition by range (CREATETIME);
create table PART_313 partition of CH_SRV_FEEDBACK for values in (313) partition by range (CREATETIME);
create table PART_314 partition of CH_SRV_FEEDBACK for values in (314) partition by range (CREATETIME);
create table PART_315 partition of CH_SRV_FEEDBACK for values in (315) partition by range (CREATETIME);
create table PART_316 partition of CH_SRV_FEEDBACK for values in (316) partition by range (CREATETIME);
create table PART_317 partition of CH_SRV_FEEDBACK for values in (317) partition by range (CREATETIME);
create table PART_318 partition of CH_SRV_FEEDBACK for values in (318) partition by range (CREATETIME);
create table PART_319 partition of CH_SRV_FEEDBACK for values in (319) partition by range (CREATETIME);
create table PART_310_202001 partition of PART_310 for values from ('2020-01-01') to ('2020-02-01');
create table PART_310_202002 partition of PART_310 for values from ('2020-02-01') to ('2020-03-01');
create table PART_310_202003 partition of PART_310 for values from ('2020-03-01') to ('2020-04-01');
create table PART_310_202004 partition of PART_310 for values from ('2020-04-01') to ('2020-05-01');
create table PART_310_202005 partition of PART_310 for values from ('2020-05-01') to ('2020-06-01');
create table PART_310_202006 partition of PART_310 for values from ('2020-06-01') to ('2020-07-01');
create table PART_310_202007 partition of PART_310 for values from ('2020-07-01') to ('2020-08-01');
create table PART_310_202008 partition of PART_310 for values from ('2020-08-01') to ('2020-09-01');
create table PART_310_202009 partition of PART_310 for values from ('2020-09-01') to ('2020-10-01');
create table PART_310_202010 partition of PART_310 for values from ('2020-10-01') to ('2020-11-01');
create table PART_310_202011 partition of PART_310 for values from ('2020-11-01') to ('2020-12-01');
create table PART_310_202012 partition of PART_310 for values from ('2020-12-01') to ('2021-01-01');
wenxin=> \d+ CH_SRV_FEEDBACK
Partitioned table "public.ch_srv_feedback"
Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
------------+-------------------------+-----------+----------+------------------------+----------+--------------+-------------
surveyid | character varying(32) | | not null | | extended | |
itemid | character varying(32) | | not null | | extended | |
operid | character varying(32) | | not null | | extended | |
optionid | character varying(2) | | not null | '0'::character varying | extended | |
region | bigint | | not null | | plain | |
answer | character varying(1024) | | | | extended | |
createtime | date | | not null | | plain | |
Partition key: LIST (region)
Partitions: part_310 FOR VALUES IN ('310'), PARTITIONED,
part_311 FOR VALUES IN ('311'), PARTITIONED,
part_312 FOR VALUES IN ('312'), PARTITIONED,
part_313 FOR VALUES IN ('313'), PARTITIONED,
part_314 FOR VALUES IN ('314'), PARTITIONED,
part_315 FOR VALUES IN ('315'), PARTITIONED,
part_316 FOR VALUES IN ('316'), PARTITIONED,
part_317 FOR VALUES IN ('317'), PARTITIONED,
part_318 FOR VALUES IN ('318'), PARTITIONED,
part_319 FOR VALUES IN ('319'), PARTITIONED
wenxin=> \d+ CH_SRV_FEEDBACK part_310
Partitioned table "public.ch_srv_feedback"
Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
------------+-------------------------+-----------+----------+------------------------+----------+--------------+-------------
surveyid | character varying(32) | | not null | | extended | |
itemid | character varying(32) | | not null | | extended | |
operid | character varying(32) | | not null | | extended | |
optionid | character varying(2) | | not null | '0'::character varying | extended | |
region | bigint | | not null | | plain | |
answer | character varying(1024) | | | | extended | |
createtime | date | | not null | | plain | |
Partition key: LIST (region)
Partitions: part_310 FOR VALUES IN ('310'), PARTITIONED,
part_311 FOR VALUES IN ('311'), PARTITIONED,
part_312 FOR VALUES IN ('312'), PARTITIONED,
part_313 FOR VALUES IN ('313'), PARTITIONED,
part_314 FOR VALUES IN ('314'), PARTITIONED,
part_315 FOR VALUES IN ('315'), PARTITIONED,
part_316 FOR VALUES IN ('316'), PARTITIONED,
part_317 FOR VALUES IN ('317'), PARTITIONED,
part_318 FOR VALUES IN ('318'), PARTITIONED,
part_319 FOR VALUES IN ('319'), PARTITIONED
wenxin-> \d+ part_310
Partitioned table "public.part_310"
Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
------------+-------------------------+-----------+----------+------------------------+----------+--------------+-------------
surveyid | character varying(32) | | not null | | extended | |
itemid | character varying(32) | | not null | | extended | |
operid | character varying(32) | | not null | | extended | |
optionid | character varying(2) | | not null | '0'::character varying | extended | |
region | bigint | | not null | | plain | |
answer | character varying(1024) | | | | extended | |
createtime | date | | not null | | plain | |
Partition of: ch_srv_feedback FOR VALUES IN ('310')
Partition constraint: ((region IS NOT NULL) AND (region = '310'::bigint))
Partition key: RANGE (createtime)
Partitions: part_310_202001 FOR VALUES FROM ('2020-01-01') TO ('2020-02-01'),
part_310_202002 FOR VALUES FROM ('2020-02-01') TO ('2020-03-01'),
part_310_202003 FOR VALUES FROM ('2020-03-01') TO ('2020-04-01'),
part_310_202004 FOR VALUES FROM ('2020-04-01') TO ('2020-05-01'),
part_310_202005 FOR VALUES FROM ('2020-05-01') TO ('2020-06-01'),
part_310_202006 FOR VALUES FROM ('2020-06-01') TO ('2020-07-01'),
part_310_202007 FOR VALUES FROM ('2020-07-01') TO ('2020-08-01'),
part_310_202008 FOR VALUES FROM ('2020-08-01') TO ('2020-09-01'),
part_310_202009 FOR VALUES FROM ('2020-09-01') TO ('2020-10-01'),
part_310_202010 FOR VALUES FROM ('2020-10-01') TO ('2020-11-01'),
part_310_202011 FOR VALUES FROM ('2020-11-01') TO ('2020-12-01'),
part_310_202012 FOR VALUES FROM ('2020-12-01') TO ('2021-01-01')
pg 多级分区表 list-range
最新推荐文章于 2024-01-15 13:31:30 发布