Skip to content

Instantly share code, notes, and snippets.

create table tbl (
part_key1 int,
part_key2 int,
part_key3 int,
part_key4 int,
values_columns varchar
) partition by list(part_key1);
create table tbl_p1 partition of tbl for values in (1) partition by list(part_key2);
create table tbl_p1_p2 partition of tbl_p1 for values in (1) partition by range (part_key3);
create table tbl_p1_p2_p3 partition of tbl_p1_p2 (constraint tbl_p1_p2_p3_pkey primary key (part_key3, part_key4)) for values from (0) to (100) partition by HASH(part_key4);