(1) 索引唯一扫描(index unique scan)

(2) 索引范围扫描(index range scan)

(3) 索引全扫描(index full scan)

(4) 索引快速扫描(index fast full scan)



create table fang(id number constraint pk primary key,name varchar2(10))

begin

   for i in 1..10000 loop

   insert into fang values(i,i);

   end loop;

   commit;

end;


(1) 索引唯一扫描(index unique scan)

SQL> select * from fang where id=1;       ----主键或者唯一索引,返回一行时

执行计划

----------------------------------------------------------

Plan hash value: 1490543307


SELECT STATEMENT

TABLE ACCESS BY INDEX ROWID

INDEX UNIQUE SCAN

(2) 索引范围扫描(index range scan)

SQL> select * from fang where id<1;      ----范围条件时


执行计划

SELECT STATEMENT  

TABLE ACCESS BY INDEX ROWID|

INDEX RANGE SCAN     

(3) 索引全扫描(index full scan)

SQL> select id from fang order by id----请求列在索引中,且返回结果要求排序


执行计划

SELECT STATEMENT 

 INDEX FULL SCAN 

(4) 索引快速扫描(index fast full scan)   ----请求列在索引中,返回结果不用排序


执行计划

SQL> select id from fang;

 SELECT STATEMENT     

INDEX FAST FULL SCAN