-
Hi: I create a table used range and hash partition,the hash partition col is the primary key column
,the sql is below.I do not know what I do it correct considing the performance? Thanks !!!
create table sales (
customer_id number(6),
sale_date date,
amount number(10) )
PARTITION BY RANGE(sale_date)
SUBPARTITION BY HASH(customer_id)
SUBPARTITIONS 2
( PARTITION p1 VALUES LESS THAN (to_date('2002/01/01','yyyy/mm/dd'))
STORAGE (INITIAL 20m NEXT 20m minextents 10)
(SUBPARTITION cdr_02_1999_01 TABLESPACE tbs1,
SUBPARTITION cdr_02_1999_02 TABLESPACE tbs2 ),
PARTITION p2 VALUES LESS THAN (MAXVALUE)
STORAGE (INITIAL 20m NEXT 20m minextents 10)
(SUBPARTITION cdr_05_1999_01 TABLESPACE tbs3 ,
SUBPARTITION cdr_05_1999_02 TABLESPACE tbs4));
alter table sales add constraint PK_t_relations_phone primary key(customer_id)
using index tablespace indx storage(initial 10m next 10m minextents 4);
-
You can think of creating a local index on this partitioned table where the index will be equally partitioned based on the underlying table and will be managed automatically by oracle when ever the maintanance is going on the underlying table.
regards
anandkl
anandkl
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|