I have what I feel is a really simple question about Oracle 9i and the performance of the "Order By" clause. I pose this question because my company DBA's are being rather dogmatic about their response. The situation that I have is this - I have a simple query with an order_by clause on it.
select * from table_a
where fld_a > x
and fld_a <= y
order by fld_a;
table_a has "N" number of columns
fld_a is the primary_key - it is a single column primary key.
My predicament is this. The dba's in my organization are dogmatic about not using the 'order by' clause. They state that an external sort of the resultset would be more efficient than using the 'order by' clause. My question is this - why? I am becoming suspect of their answer - mostly because they won't tell me why.
I could understand their answer if the 'order by' clause was not on the primary key field. I am questioning about this specific case.
It shouldn't make any difference but this query will be running on Oracle 9i/HP-UX 11i...
Rick Agolia
select * from table_a
where fld_a > x
and fld_a <= y
order by fld_a;
table_a has "N" number of columns
fld_a is the primary_key - it is a single column primary key.
My predicament is this. The dba's in my organization are dogmatic about not using the 'order by' clause. They state that an external sort of the resultset would be more efficient than using the 'order by' clause. My question is this - why? I am becoming suspect of their answer - mostly because they won't tell me why.
I could understand their answer if the 'order by' clause was not on the primary key field. I am questioning about this specific case.
It shouldn't make any difference but this query will be running on Oracle 9i/HP-UX 11i...
Rick Agolia