【发布时间】:2015-12-02 23:50:02
【问题描述】:
在表格的简化结构下:
create table customer(
incident_id number,
customer_id number,
customer_name varchar2(400),
sla_id number
failure_start_date date,
failure_end_date date,
churn_flag number, -- 0 or 1
active number, -- 0 or 1
constraint pk_incident_id primary key (incident_id))
PARTITION BY LIST (active)
SUBPARTITION BY LIST (churn_flag)
SUBPARTITION TEMPLATE
( SUBPARTITION sp_churn_flag_1 VALUES (1)
, SUBPARTITION sp_churn_flag_0 VALUES (0)
)
(PARTITION sp_active_1 values (1)
, PARTITION sp_active_0 VALUES (0)
)
,
ENABLE ROW MOVEMENT COMPRESS FOR QUERY LOW;
现在我需要在现有的 Composite-List-Partition 中添加一个 Interval-Range-Partitioning,以便按月(failure_starte_date - YYYYMM)对数据进行分区。该表包含从 200701 到现在 (201511) 的数据。 failure_start_date
【问题讨论】:
-
您是说,您希望每个
churn_flag子分区每个月包含多个子分区吗?如果有,有什么用? -
是的,这就是我想要归档的内容。做什么的?我有很多可以通过这种方式合理划分的数据。它将提高查询此表的报告工具的性能。
-
因此,您有很多查询,其中指定了
active、churn_flag、和failure_start_date、和的间隔返回的数据太多以至于您需要扫描分区而不是通过索引访问数据? -
没错。你知道我需要如何对现有分区进行分区吗?
标签: oracle database-partitioning