The difference between the two queries here is that Oracle knows that it cannot return any rows of the GROUP BY query until it has identified all of the required rows -- normally the GROUP BY would be accompanied by an aggregate function such as SUM(), but just beacuse it is not there doesn't mean that Oracle won't perform the required sorting anyway. Oracle reads the table with a ful table scan because it believes that to be the fastest way of identifying all of the required rows.
In the first query Oracle can return rows as soon as they are identified as part of the result set, and it might find the first row quicker using an index.
So this all comes about because the optimizer mode is FIRST_ROWS.
I also note that in 9.2.0.6 you ought to investigate the use of the DBMS_STATS.GATHER_SYSTEM_STATS procedure to collect statistics on multiblock and single block read times, to aid the optimizer in deciding whether index or table access would be faster.
Bookmarks