Oracle 11g 不可见索引案例(3)

12:02:49 SCOTT@ enmo> select table_name,index_name,leaf_blocks,status,VISIBILITY FROM USER_INDEXES
12:06:03  2  where table_name='EMP1';
TABLE_NAME                    INDEX_NAME                    LEAF_BLOCKS STATUS  VISIBILIT
------------------------------ ------------------------------ ----------- -------- ---------
EMP1                          EMP1_NAME_IND                            1 VALID    INVISIBLE

12:26:11 SCOTT@ enmo>  select /*+ index(emp1 emp1_name_ind) */ * from emp1 where ename='SCOTT'
    EMPNO ENAME      JOB              MGR HIREDATE        SAL      COMM    DEPTNO
---------- ---------- --------- ---------- --------- ---------- ---------- ----------
      7788 SCOTT      ANALYST        7566 19-APR-87      3000                    20
Elapsed: 00:00:00.01
Execution Plan
----------------------------------------------------------
Plan hash value: 2226897347
--------------------------------------------------------------------------
| Id  | Operation        | Name | Rows  | Bytes | Cost (%CPU)| Time    |
--------------------------------------------------------------------------
|  0 | SELECT STATEMENT  |      |    1 |    38 |    3  (0)| 00:00:01 |
|*  1 |  TABLE ACCESS FULL| EMP1 |    1 |    38 |    3  (0)| 00:00:01 |
--------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
  1 - filter("ENAME"='SCOTT')

Statistics
----------------------------------------------------------
          0  recursive calls
          0  db block gets
          4  consistent gets
          0  physical reads
          0  redo size
        863  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

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/a05b39ce4b33645647e12492949ee4aa.html