|
Oracle中分区表的使用(39) 6 partition idx_3 tablespace dinya_space03 7 );
Index created.
SQL>
看查询的执行计划,从下面的执行计划可以看出,系统已经使用了索引: SQL> select * from dinya_test partition(part_01) t where t.item_id=12; Execution Plan ---------------------------------------------------------- 0 SELECT STATEMENT Optimizer=CHOOSE (Cost=2 Card=1 Bytes=187) 1 0 TABLE Access (BY LOCAL INDEX ROWID) OF 'DINYA_TEST' (Cost= 2 Card=1 Bytes=187) 2 1 INDEX (RANGE SCAN) OF 'DINYA_IDX_T' (NON-UNIQUE) (Cost=1 Card=1) StatistiCS ---------------------------------------------------------- 0 recursive calls 0 db block gets 4 consistent gets 0 physical reads 0 redo size 334 bytes sent via SQL*Net to client 309 bytes received via SQL*Net from client 2 SQL*Net roundtrips to/from client 1 sorts (memory) 0 sorts (disk) 2 rows processed SQL> 3.2 全局索引分区的建立。全局索引建立时global 子句允许指定索引的范围值,这个范围值为索引字段的范围值: SQL> create index dinya_idx_t on dinya_test(item_id)
|