postgresql 表分区

postsql 10 以上

 

-- 范围分区
create  table "tab_medaid"(
    "id" varchar NOT NULL,
    "create_time" date
)partition by range (create_time);


Create  table tab_medaid_01 PARTITION OF  tab_medaid for values  from ('2022_10_08') to ('2022_10_09')


-- 列分区

create table fenbiao(
id int,
year varchar
) partition by list(year);

create table fenbiao_2022 partition of fenbiao for values in ('2022');
create table fenbiao_2023 partition of fenbiao for values in ('2023');

你可能感兴趣的:(postgresql 表分区)