我一直在使用哈希partitons一个相当庞大的表:oracle多个散列分区平行吗?
create table test
(
custid VARCHAR2 (16) NOT NULL
,channel NUMBER(10)
,agent_id CHAR(8)
,TIMESTAMP DATE
) cache
PARTITION BY HASH(agent_id)
(
partition e1 tablespace TD_RTDM,
partition e12 tablespace TD_RTDM,
partition e13 tablespace TD_RTDM,
partition e14 tablespace TD_RTDM,
partition e15 tablespace TD_RTDM,
partition e16 tablespace TD_RTDM,
partition e17 tablespace TD_RTDM,
partition e18 tablespace TD_RTDM
);
此作品不错,当我在AGENT_ID过滤。 现在我有一个新的水平,我需要过滤,其中不包括agent_id。所以我想我需要N个新的并行散列分区是这样的:
create table test
(
custid VARCHAR2 (16) NOT NULL
,channel NUMBER(10)
,agent_id CHAR(8)
,TIMESTAMP DATE
) cache
PARTITION BY HASH(agent_id)
(
partition e1 tablespace TD_RTDM,
partition e12 tablespace TD_RTDM,
partition e13 tablespace TD_RTDM,
partition e14 tablespace TD_RTDM,
partition e15 tablespace TD_RTDM,
partition e16 tablespace TD_RTDM,
partition e17 tablespace TD_RTDM,
partition e18 tablespace TD_RTDM
)
PARTITION BY HASH(channel)
(
partition e1 tablespace TD_RTDM,
partition e12 tablespace TD_RTDM,
partition e13 tablespace TD_RTDM
);
但这不起作用,因为它显然不允许有多个分区的语句。我GOOGLE了一下,发现了很多使用子分区的例子,但我认为这不是我所需要的。
你有什么想法,如何调整表以获得两个查询性能?谢谢e。
在'channel'上创建一个索引? –
@戈登林诺肯定。我有充足的余地。 – Ele
本地或全局索引? –