您的位置:首页 > 数据库 > Oracle

索引的几种访问方法-续(SKIP SCAN)

2014-10-01 11:22 302 查看
SQL> exec dbms_stats.gather_table_stats(ownname =>'SCOTT',TABNAME =>'SKIP_IDX_EMP',estimate_percent =>100,cascade =>true,method_opt =>'for all columns size 1');

PL/SQL procedure successfully completed.

SQL> select * from skip_idx_emp;

10000 rows selected.

Execution Plan

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

Plan hash value: 1119378318

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

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

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

|   0 | SELECT STATEMENT  | | 10000 | 50000 |     6   (0)| 00:00:01 |

|   1 |  TABLE ACCESS FULL| SKIP_IDX_EMP | 10000 | 50000 |     6   (0)| 00:00:01 |

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

Statistics

----------------------------------------------------------
 0  recursive calls
 0  db block gets
690  consistent gets
 0  physical reads
 0  redo size

     234300  bytes sent via SQL*Net to client

       7795  bytes received via SQL*Net from client
668  SQL*Net roundtrips to/from client
 0  sorts (memory)
 0  sorts (disk)

      10000  rows processed

SQL> select * from skip_idx_emp where emp_id=1000;

Execution Plan

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

Plan hash value: 3164335757

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

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

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

|   0 | SELECT STATEMENT |    |
 1 |  5 |
 3   (0)| 00:00:01 |

|*  1 |  INDEX SKIP SCAN | IDX_SKIP_IDX_EMP |
 1 |  5 |
 3   (0)| 00:00:01 |

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

Predicate Information (identified by operation id):

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

   1 - access("EMP_ID"=1000)

       filter("EMP_ID"=1000)

Statistics

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

SQL> 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  oracle索引形式