我一直在使用哈希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
本地或全局索引? –