INDEX FULL SCAN和INDEX FAST FULL SCAN不同

—请记住这么些INDEX FULL SCAN扫描格局,并咀嚼与INDEX FAST FULL
SCAN的不一样

drop table t purge;
create table t as select * from dba_objects;
update t set object_id=rownum;
commit;
alter table T modify object_id not null;
create  index idx_object_id on t(object_id);
set autotrace traceonly
set linesize 1000

select * from t  order by object_id;

ACCESS,执行安排

| Id  | Operation                   | Name          | Rows  | Bytes |

Cost (%CPU)| Time     |

|   0 | SELECT STATEMENT            |               | 88780 |    17M|
 1208   (1)| 00:00:15 |
|   1 |  TABLE ACCESS BY INDEX ROWID| T             | 88780 |    17M|
 1208   (1)| 00:00:15 |
|   2 |   INDEX FULL SCAN           | IDX_OBJECT_ID | 88780 |       |

  164   (1)| 00:00:02 |

总括音信

          0  recursive calls
          0  db block gets
      10873  consistent gets
          0  physical reads
          0  redo size
    8116181  bytes sent via SQL*Net to client
      54040  bytes received via SQL*Net from client
       4877  SQL*Net roundtrips to/from client
          0  sorts (memory)
          0  sorts (disk)
      73130  rows processed

drop table t purge;
create table t as select * from dba_objects ;
update t set object_id=rownum;
commit;
alter table T modify object_id not null;
create  index idx_object_id on t(object_id);
set autotrace traceonly
set linesize 1000

select count(*) from t;

实践布置

| Id  | Operation             | Name          | Rows  | Cost (%CPU)|

Time     |

|   0 | SELECT STATEMENT      |               |     1 |    49   (0)|
00:00:01 |
|   1 |  SORT AGGREGATE       |               |     1 |            |    
     |
|   2 |   INDEX FAST FULL SCAN| IDX_OBJECT_ID | 88780 |    49   (0)|

00:00:01 |

计算新闻

          0  recursive calls
          0  db block gets
        170  consistent gets
          0  physical reads
          0  redo size
        425  bytes sent via SQL*Net to client
        415  bytes received via SQL*Net from client
          2  SQL*Net roundtrips to/from client
          0  sorts (memory)
          0  sorts (disk)
          1  rows processed

总括:fast为无序读,两次读取多少个块,full为平稳读,每便读取单个块。
梁先生课程统计。

相关文章