Greenplum create table

create table sanguozhi (id bigint, name varchar(32), country varchar(8), url varchar(128), ip varchar(16), uuid varchar(36), agent varchar(128), detail varchar(512), birthday date) WITH (appendonly=true) distributed by (id) partition by range(birthday) (START('0200-01-01') END('0300-01-01') EVERY('0001-00-00'), DEFAULT PARTITION sgz_partition);app

appendonly 表不能有unique index,主键是一种primary key,因此不能有。性能

 

若是有主键,则不能是appendonly 表,为了追求查询性能,由于用外部表导入的话,插入不是问题了。ui

 

create table sanguozhi (id bigint, name varchar(32), country varchar(8), url varchar(128), ip varchar(16), uuid varchar(36), agent varchar(128), detail varchar(512), birthday date,primary key(id,birthday)) WITH  distributed by (id) partition by range(birthday) (START('0200-01-01') END('0300-01-01') EVERY('0001-00-00'), DEFAULT PARTITION sgz_partition);url

相关文章
相关标签/搜索