Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: SQL Query: Order by Question.

Re: SQL Query: Order by Question.

From: Daniel A. Morgan <Daniel.Morgan_at_attws.com>
Date: Fri, 22 Jun 2001 17:26:41 -0700
Message-ID: <3B33E241.6783D4F@attws.com>

Atul Pinge wrote:

> Hello everybody,
>
> I need to read the records using an sql query and read them in reverse
> order on an index (The index is not a descending index). I can use
> order by clause to do it. But are the records sorted after they are
> read from the database on the index? Then it'll be really expensive for
> big tables, right? Or is Oracle query optimizer intelligent enough to
> read the data in reverse order on an index? Does anybody know? Thanks
> in advance...
>
> Atul

ORDER BY sorts the result set ... not the query itself. And if you EXPLAIN PLAN a query ... adding an ORDER BY increases the cost.

Daniel A. Morgan Received on Fri Jun 22 2001 - 19:26:41 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US