The index unique scan, which is a scan of a unique index, applies only to the target SQL that is the equivalent query in the WHERE condition. Because the scanned object is a unique index, the results of the index uniqueness scan will return at most one record.
Empno is primary key in the EMP table, corresponding to a unique index
[Email protected]> SELECT * from emp where empno=7369;
Execution plan
----------------------------------------------------------
Plan Hash value:2949544139
--------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU) | Time |
--------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 38 | 1 (0) | 00:00:01 |
| 1 | TABLE ACCESS by INDEX rowid| EMP | 1 | 38 | 1 (0) | 00:00:01 |
|* 2 | INDEX UNIQUE SCAN | Pk_emp | 1 | | 0 (0) | 00:00:01 |
--------------------------------------------------------------------------------------
predicate information (identified by Operation ID):
---------------------------------------------------
2-access ("EMPNO" =7369)
Statistical information
----------------------------------------------------------
Recursive calls
0 db Block gets
Consistent gets
Physical Reads
0 Redo Size
898 bytes sent via sql*net to client
533 Bytes received via sql*net from client
1 sql*net roundtrips To/from Client
8 Sorts (memory)
0 Sorts (disk)
1 rows processed
[Email protected]>
View Code
As you can see from the above, the execution plan for "select * from emp where empno=7369" is an index-unique scan.
Index uniqueness Scan (index unique scan)