kingbaseESV8分区表

--partition by range
CREATE TABLE t01 (
    age int not null,
    city varchar not null
) PARTITION BY RANGE (age);
create table t01_r1 partition of t01 for values from (MINVALUE) to (10);
create table t01_r2 partition of t01 for values from (11) to (20);
create table t01_r3 partition of t01 for values from (21) to (30);
create table t01_r4 partition of t01 for values from (31) to (MAXVALUE);

create table public.student(
id int,
citycode char(6),
startdate timestamp
)
partition by range(startdate);
create table public.student_p1 partition of student for values from ('2007-01-01') to ('2007-03-31');
create table public.student_p2 partition of student for values from ('2007-04-01') to ('2007-06-30');
create table public.student_p3 partition of student default;

--partition by list
create table public.student(
id int,
citycode char(6)
)
partition by list (citycode);
create table public.student_p1 partition of student for values in ('110000');
create table public.student_p2 partition of student for values in ('120000');
create table public.student_p3 partition of student for values in ('130000');
create table public.student_p4 partition of student default;

--partition by hash
create table public.student(
id int,
citycode char(6),
startdate timestamp
)
partition by hash(id);
create table public.student_p1 partition of student for values with(modulus 4,remainder 0);
create table public.student_p2 partition of student for values with(modulus 4,remainder 1);
create table public.student_p3 partition of student for values with(modulus 4,remainder 2);
create table public.student_p4 partition of student for values with(modulus 4,remainder 3);

explain select * from student where id=1;

--修改参数
show constraint_exclusion;
set constraint_exclusion=partition;
 

相关推荐

  1. kingbaseESV8分区

    2024-03-25 13:36:02       16 阅读
  2. kingbaseESV8常用语句

    2024-03-25 13:36:02       16 阅读
  3. kingbaseESV8逻辑备份还原

    2024-03-25 13:36:02       13 阅读
  4. kingbaseESV8常用ksql命令

    2024-03-25 13:36:02       19 阅读
  5. Mysql8 创建,按年/月分区存储

    2024-03-25 13:36:02       14 阅读
  6. 分库,分,分区,分片

    2024-03-25 13:36:02       16 阅读
  7. 【PostgreSQL】管理-分区

    2024-03-25 13:36:02       29 阅读
  8. oracle分区分区exchange

    2024-03-25 13:36:02       21 阅读

最近更新

  1. TCP协议是安全的吗?

    2024-03-25 13:36:02       18 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2024-03-25 13:36:02       19 阅读
  3. 【Python教程】压缩PDF文件大小

    2024-03-25 13:36:02       18 阅读
  4. 通过文章id递归查询所有评论(xml)

    2024-03-25 13:36:02       20 阅读

热门阅读

  1. Github 2024-03-21 开源项目日报 Top10

    2024-03-25 13:36:02       15 阅读
  2. 计算方法(第3版)——学习笔记(一)

    2024-03-25 13:36:02       17 阅读
  3. Python之关键字传参(**kwargs)妙处

    2024-03-25 13:36:02       13 阅读
  4. 说一下你对dom驱动和数据驱动的理解

    2024-03-25 13:36:02       17 阅读
  5. 移位补位(1)

    2024-03-25 13:36:02       21 阅读
  6. 多线程(9)Thread类和Runnable接口

    2024-03-25 13:36:02       16 阅读
  7. 茄子科技前端实习面经

    2024-03-25 13:36:02       22 阅读
  8. 24计算机考研调剂 | 广西科技大学

    2024-03-25 13:36:02       19 阅读
  9. kingbaseESV8常用ksql命令

    2024-03-25 13:36:02       19 阅读