oracle automatic selection index

If the table has more than two (including two) index, which has a unique index, and the other non-uniqueness.

In this case, ORACLE will use the unique index and completely ignore the non-uniqueness of the index.

For example:

SELECT ENAME

FROM EMP

WHERE EMPNO = 2326 

AND DEPTNO  = 20 ;

Here, only the index on the EMPNO is unique in nature, so EMPNO index will be used to retrieve records.

TABLE ACCESS BY ROWID ON EMP

       INDEX UNIQUE SCAN ON EMP_NO_IDX

Guess you like

Origin www.cnblogs.com/fanweisheng/p/11125016.html