從Oraclei開始索引跳躍式掃描特性可以允許優化器使用組合索引即便索引的前導列沒有出現在WHERE子句中索引跳躍式掃描比全索引掃描要快的多下面的程序清單顯示出性能的差別
create index idx_skip on emp(jobempno);
index created
select count(*)
from emp
where empno=;
Elapsed:::
Execution Plan
SELECT STATEMENT Optimizer=CHOOSE(Cost= Card= Bytes=)
SORT(AGGREGATE)
INDEX(FAST FULL SCAN) OF idx_skip(NONUNIQUE)
Statistics
consistent gets
physical reads
select /*+ index(emp idx_skip)*/ count(*)
from emp
where empno=;
Elapsed:::
Execution Plan
SELECT STATEMENT Optimizer=CHOOSE(Cost= Card= Bytes=)
SORT(AGGREGATE)
INDEX(SKIP SCAN) OF idx_skip (NONUNIQUE)
Statistics
consistent gets
physical reads
From:http://tw.wingwit.com/Article/program/Oracle/201311/18500.html