- 创建数据库表。
- 创建一个复制表。
create table t1 (c1 int primary key, c2 int, c3 int, index i1 (c2));
- 创建hash分区,分区数为8的表。
- 创建一级分区为range分区,二级分区为key分区的表。
create table t1 (c1 int, c2 int, c3 int)
(partition p0 values less than(0), partition p1 values less than(100));
- 创建一列为gbk, 一列为utf8的表。
- 开启encoding并使用zstd压缩,宏块保留空间为5%。
create table t1 (c1 int, c2 int, c3 varchar(64))
ROW_FORMAT dynamic
pctfree 5;