Well, the rowids will be sorted WITHIN THE SAME KEY1,KEY2,... KEYN value.
But not across them.
What I mean is, suppose the index is on:
create index i on emp(ename,job);
then the index data would be sorted by ename,job,ROWID.
If you query:select * from emp where ename like 'A%';
then the rowids returned from that would not be in order - since we skip over JOBs and the rowids are sorted inside of ENAME,JOB - but not inside of ENAME by itself.
You can and will see query plans that look like this:
create index t1_something_index
select * from t1, t2 where t1.something = :x and t1.key = t2.key;
ops$tkyte%ORA9IR2> create table t1 ( x, y )
2 as
3 select rownum, rownum from all_objects;
Table created.
ops$tkyte%ORA9IR2>
ops$tkyte%ORA9IR2> create table t2 ( a , b , c )
2 as
3 select rownum, rownum, rownum from all_objects;
Table created.
ops$tkyte%ORA9IR2>
ops$tkyte%ORA9IR2> create index t1_y_index on t1(y);
Index created.
ops$tkyte%ORA9IR2> create index t2_a_b_index on t2(a,b);
Index created.
ops$tkyte%ORA9IR2>
ops$tkyte%ORA9IR2> exec dbms_stats.gather_table_stats( user, 'T1', cascade=>true );
PL/SQL procedure successfully completed.
ops$tkyte%ORA9IR2> exec dbms_stats.gather_table_stats( user, 'T2', cascade=>true );
PL/SQL procedure successfully completed.
ops$tkyte%ORA9IR2> set autotrace traceonly explain
ops$tkyte%ORA9IR2> select * from t1, t2 where t1.y = 42 and t1.x = t2.a;
Execution Plan
----------------------------------------------------------
0 SELECT STATEMENT Optimizer=CHOOSE (Cost=4 Card=1 Bytes=22)
1 0 TABLE ACCESS (BY INDEX ROWID) OF 'T2' (Cost=2 Card=1 Bytes=13)
2 1 NESTED LOOPS (Cost=4 Card=1 Bytes=22)
3 2 TABLE ACCESS (BY INDEX ROWID) OF 'T1' (Cost=2 Card=1 Bytes=9)
4 3 INDEX (RANGE SCAN) OF 'T1_Y_INDEX' (NON-UNIQUE) (Cost=1 Card=1)
5 2 INDEX (RANGE SCAN) OF 'T2_A_B_INDEX' (NON-UNIQUE) (Cost=1 Card=1)
ops$tkyte%ORA9IR2> set autotrace off
see how the table access of t2 is "outside" of the loop? That is because the optimizer decided to wait to access T2 until AFTER it got all of the index entries for T2 so it could arrange them by ROWID to make the access more efficient.