创建表空间:
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;创建表空间:
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);创建索引分区:
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根据查询条件自动将扫描范围缩小到一个或几个表(索引)分区上。这种方式其实是分区扫描替代了全表扫描。 Partition-Wise Join:如果连接查询的两张表都在连接列上进行分区,则Oracle会优化连接操作,将一个大的连接分成各个对应分区间的连接,而且这些分区连接操作还可以并行执行。 并行DML:采用并行执行,可以使操作并行在各个分区上同时执行,从而提供执行效率。
新闻热点
疑难解答