select min(transcation_id) from table where status_cd = 'P' ;
is the fastest execution statement.
I have tested a customer table with 1M rows out of which 900000 rows have status "A" active and 100000 rows have "I" inactive.
When I use MIN function, the optimizer selects SORT AGGREGATE, where in the "SELECT * from CUSTOMER where status= 'A' order by some_column DESC; " statement the optimizer selects SORT ORDER BY.
The FIRST_ROWS hint does not help in this situation, even if I use cursor with DESCending column.
Click Here to Expand Forum to Full Width