you'll never get an index unique scan on the index - but that should be OK in general
ops$tkyte%ORA11GR2> create table t
2 ( x int,
3 y int,
4 z int,
5 data varchar2(20),
6 constraint t_pk primary key (x, y) using index (create index t_pk on t(x, y, z))
7 )
8 /
Table created.
ops$tkyte%ORA11GR2> exec gen_data( 'T', 10000 );
PL/SQL procedure successfully completed.
ops$tkyte%ORA11GR2> exec dbms_stats.gather_table_stats( user, 'T', cascade => true );
PL/SQL procedure successfully completed.
ops$tkyte%ORA11GR2>
ops$tkyte%ORA11GR2> set autotrace traceonly explain
ops$tkyte%ORA11GR2> select * From t where x = 1 and y = 2;
Execution Plan
----------------------------------------------------------
Plan hash value: 3772518221
------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 42 | 3 (0)| 00:00:01 |
| 1 | TABLE ACCESS BY INDEX ROWID| T | 1 | 42 | 3 (0)| 00:00:01 |
|* 2 | INDEX RANGE SCAN | T_PK | 1 | | 2 (0)| 00:00:01 |
------------------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
2 - access("X"=1 AND "Y"=2)
ops$tkyte%ORA11GR2> alter table t drop constraint t_pk drop index;
Table altered.
ops$tkyte%ORA11GR2> alter table t add constraint t_pk primary key(x,y);
Table altered.
ops$tkyte%ORA11GR2> select * From t where x = 1 and y = 2;
Execution Plan
----------------------------------------------------------
Plan hash value: 1303508680
------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 42 | 2 (0)| 00:00:01 |
| 1 | TABLE ACCESS BY INDEX ROWID| T | 1 | 42 | 2 (0)| 00:00:01 |
|* 2 | INDEX UNIQUE SCAN | T_PK | 1 | | 1 (0)| 00:00:01 |
------------------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
2 - access("X"=1 AND "Y"=2)
ops$tkyte%ORA11GR2> set autotrace off