創(chuàng)建表空間:
create tablespace ts_1 datafile 'xx.dbf' size 10m extent management local autoallocate;create tablespace ts_2 datafile 'xx.dbf' size 10m extent management local autoallocate;create tablespace ts_3 datafile 'xx.dbf' size 10m extent management local autoallocate;創(chuàng)建表空間:
create table table_name(column1 varchar2(10)column2 varchar2(10)column3 varchar2(10))partition by range(column2)(partition partition_name values less than(x1) tablespace ts_1,partition partition_name values less than(x2) tablespace ts_2,partition partition_name values less than(x3) tablespace ts_3);創(chuàng)建索引分區(qū):
create index index_name on table(column2)local(partition partition_name tablespace ts_1,partition partition_name tablespace ts_2,partition partition_name tablespace ts_3)Partition PRuning:Oracle根據(jù)查詢條件自動將掃描范圍縮小到一個或幾個表(索引)分區(qū)上。這種方式其實是分區(qū)掃描替代了全表掃描。 Partition-Wise Join:如果連接查詢的兩張表都在連接列上進行分區(qū),則Oracle會優(yōu)化連接操作,將一個大的連接分成各個對應分區(qū)間的連接,而且這些分區(qū)連接操作還可以并行執(zhí)行。 并行DML:采用并行執(zhí)行,可以使操作并行在各個分區(qū)上同時執(zhí)行,從而提供執(zhí)行效率。
新聞熱點
疑難解答