一个表上有多个分区? [英] Multiple partitions on a table?

查看:194
本文介绍了一个表上有多个分区?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的印象是可以在一个表上放置多个分区,所以当我输入以下代码时,这让我感到惊讶:

I was under the impression that multiple partitions could be placed on a table, so it surprised me when I entered the following code:

CREATE TABLE ParentDetails1
(ParentID INTEGER NOT NULL,
ParentName VARCHAR (50) NOT NULL,
DateOfBirth DATE NOT NULL,
Gender VARCHAR (10) CHECK (Gender IN ('m', 'f')) NOT NULL,
CONSTRAINT ParentDetails_PK PRIMARY KEY (ParentID))
PARTITION BY RANGE (ParentName)
    (partition ParentNamePartition1 VALUES LESS THAN ('B'),
     partition ParentNamePartition2 VALUES LESS THAN ('D'),
     partition ParentNamePartition3 VALUES LESS THAN ('F'),
     partition ParentNamePartition4 VALUES LESS THAN ('H'),
     partition ParentNamePartition5 VALUES LESS THAN ('J'),
     partition ParentNamePartition6 VALUES LESS THAN ('L'),
     partition ParentNamePartition7 VALUES LESS THAN ('N'),
     partition ParentNamePartition8 VALUES LESS THAN ('P'),
     partition ParentNamePartition9 VALUES LESS THAN ('R'),
     partition ParentNamePartition10 VALUES LESS THAN ('T'),
     partition ParentNamePartition11 VALUES LESS THAN ('V'),
     partition ParentNamePartition12 VALUES LESS THAN ('X'),
     partition ParentNamePartition13 VALUES LESS THAN (MAXVALUE))
PARTITION BY HASH (ParentID)
    partitions 10
PARTITION BY LIST (Gender)
    (partition ParentGenderPartition1 VALUES ('m'),
     partition ParentGenderPartition2 VALUES ('f'))
CLUSTER
    ParentContact_Cluster (ParentID);

...并收到错误消息,指出只能在一个表上输入一个分区子句?!

...and got the error stating that only one partition clause could be entered on a table?!

有没有解决的办法?

非常感谢, 祖鲁语

推荐答案

您仅限于一个表的分区方案.根据您要解决的问题,该分区方案可以同时包含分区和子分区.

You are limited to one partitioning scheme for a table. That partitioning scheme could include both partitions and subpartitions depending on the problem you are trying to solve.

在一个表上具有多个竞争分区方案甚至意味着什么?

What would it even mean to have multiple competing partitioning schemes on a single table?

这篇关于一个表上有多个分区?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆