CREATE TABLE test (c1 INT PRIMARY KEY, c2 VARCHAR(50)) REPLICA_NUM = 3, PRIMARY_ZONE = 'zone1';
CREATE TABLE item (i_id INT
, i_name VARCHAR(24)
, i_price DECIMAL(5,2)
, i_im_id INT
, PRIMARY KEY(i_id)) COMPRESS FOR QUERY pctfree=0 BLOCK_SIZE=16384
DUPLICATE_SCOPE='cluster' LOCALITY='F@zone1, F@zone2,R{all_server}@zone3' primary_zone='zone1';
create table t1 (c1 int primary key, c2 int) partition by hash(c1) partitions 8;
- 创建一级分区为 range 分区,二级分区为 hash 分区的表。
partition by range(c1) subpartition by hash(c2) subpartitions 5
(partition p0 values less than(0), partition p1 values less than(100));
- 开启 encoding 并使用 zstd 压缩,宏块保留空间为 5%。
create global temporary table t1 (c1 int) on commit delete rows ;
create table t1 (c1 int, c2 int, c3 int, CONSTRAINT equal_check CHECK(c2 = c3 * 2) ENABLE VALIDATE);