I want to create partitioned table:
create table audit
(
id number(38,0) not null enable,
audit_time timestamp(6),
description varchar2(100 byte),
constraint pk_audit primary key (id)
)
partition by range (audit_time)
interval(numtoyminterval(1, 'month'))
(
partition low_p values less than (timestamp' 2010-01-01 00:00:00')
);
create index audit_idx on audit(audit_time) local;
And there will be about 300 millions row. I can't find clear answer about partitioning of PK for partitioned table.
My questions are:
- Should I make a partitioned index for primary key?
- It must be globally partitioned or local?
- It must be hash partitioned?
- How to know how many partitions must be for that index?
It should be something like this:
CREATE INDEX audit_unq
ON audit(id)
GLOBAL PARTITION BY HASH (id)
( PARTITION p1
, PARTITION p2
, PARTITION p3
, PARTITION p4
);
or not?)
What is best practice with pk of partitoned table?