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

Home -> Community -> Usenet -> c.d.o.misc -> Re: re-ordering rows

Re: re-ordering rows

From: Andrew Babb <andrewb_at_mail.com>
Date: Sun, 25 Apr 1999 20:29:29 +0800
Message-ID: <37230AA9.B8CABCCE@mail.com>


Arjan,

You are correct that Oracle never guarantees the order of rows being returned for the database unless an ORDER BY is used. The only exception to this, is if you are capable of retrieving the rows by a INDEX RANGE SCAN (according to the execution plan), in which case, the rows are returned in the correct order.

Andrew

Arjan van Bentem wrote:

> John Higgins wrote
> > So why would anyone want to physically order the rows within a
> > table? To improve the performance of a non-unique (multi-row)
> > query. Like, "SELECT * FROM A WHERE X = "ABC";"
>
> Hmmm, I always thougt that "Oracle does not return the rows in a particular
> order" also meant "Oracle does not STORE the rows in a particular order". And
> even when it does, I always thought that DBA activities might change the
> physical order again, so a developer should never rely on it. But since the
> thing you describe seems to be common practice I believe you're right. Thanks!
>
> I still doubt that Gennady meant to achieve the thing you describe, so again
> Gennady, like John pointed out as well: please understand that Oracle only
> guarantees any ordering if you include a order by in your select.
>
> Arjan.
Received on Sun Apr 25 1999 - 07:29:29 CDT

Original text of this message

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