• 创建数据库表。
  • 创建一个复制表。
  1. CREATE TABLE item() locality = 'F,R{all_server}@hz1, F,R{all_server}@hz2,
  2. F,R{all_server}@hz3' DUPLICATE_SCOPE="cluster"
  • 创建带索引的表。
  • 创建 hash 分区,分区数为 8 的表。
    • 创建一级分区为 range 分区,二级分区为 hash 分区的表。
    1. create table t1 (c1 int, c2 int, c3 int)
    2. partition by range(c1) subpartition by hash(c2) subpartitions 5
    • 开启 encoding 并使用 zstd 压缩,宏块保留空间为 5%。
    • 创建一个事务级临时表。
    1. create global temporary table t1 (c1 int) on commit delete rows ;
    • 创建一个带约束的表。
    1. create table t1 (c1 int, c2 int, c3 int, CONSTRAINT equal_check CHECK(c2 = c3 * 2) ENABLE VALIDATE);