创建分区表 本文为您介绍如何创建分区表。 创建范围分区表 teledb create table trange (f1 bigint,f2 timestamp default now(), f3 integer) partition by range (f3) begin (1) step (50) partitions (3) distribute by shard(f1); CREATE TABLE teledb insert into trange(f1,f3) values(1,1),(2,50),(3,100),(2,110); COPY 4 teledb insert into trange(f1,f3) values(1,1),(2,50),(3,100),(2,110); COPY 4 teledb d+ trange; Table "public.trange" Column Type Collation Nullable Default Storage Stats target Description +++++++ f1 bigint plain f2 timestamp without time zone now() plain f3 integer plain Distribute By: SHARD(f1) Location Nodes: ALL DATANODES Partition By: RANGE(f3) Of Partitions: 3 Start With: 1 Interval Of Partition: 50 创建时间范围分区表 teledb create table ttimerange (f1 bigint, f2 timestamp ,f3 bigint) partition by range (f2) begin (timestamp without time zone '20170901 0:0:0') step (interval '1 month') partitions (12) distribute by shard(f1); CREATE TABLE teledb d+ ttimerange Table "public.ttimerange" Column Type Collation Nullable Default Storage Stats target Description +++++++ f1 bigint plain f2 timestamp without time zone plain f3 bigint plain Distribute By: SHARD(f1) Location Nodes: ALL DATANODES Partition By: RANGE(f2)