# 创建分区主表
CREATE TABLE core.t_trans_paymode_info
(
f_id bigint,
f_trans_id character varying(32),
f_enabled smallint,
f_pay_mode smallint,
f_amount bigint,
f_fee_amount bigint,
f_fee_rate bigint,
f_fee_count_type smallint,
f_currency smallint,
f_create_time timestamp without time zone,
f_modify_time timestamp without time zone,
f_fee_contract bigint,
f_source_flag smallint,
f_fee_rule_id integer
)
WITH (appendonly=true) DISTRIBUTED BY (f_trans_id) PARTITION BY RANGE(f_create_time) (
PARTITION m2020 START('2020-01-01'::date) END ('2021-01-01'::date) EVERY('1 mon'::interval),
PARTITION m2021 START('2021-01-01'::date) END ('2022-01-01'::date) EVERY('1 mon'::interval),
PARTITION m2022 START('2022-01-01'::date) END ('2023-01-01'::date) EVERY('1 mon'::interval),
default PARTITION other
);