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

Home -> Community -> Usenet -> c.d.o.server -> Re: Can we optimize an ORDER BY clause?

Re: Can we optimize an ORDER BY clause?

From: Sylvie Bérubé <sberube_at_cam.org>
Date: 1997/01/12
Message-ID: <32D969A2.1885@cam.org>#1/1

Vincent Qing Yin wrote:
>
> Here's a small question for Oracle programmers.
>
> I come from a Sybase back ground. I noticed that Oracle doesn't have
> the concept of a "clustered" index. In Sybase, a clustered index
> forces the physical order of records on disk to be the same as the logical
> order of the index. In a SELECT statement, if I use an ORDER BY clause
> on the columns that have the clustered index, then the server immediately
> start to return rows without actually performing the sort (because the
> sort would be unnecessary.)
>
> In Oracle, is there a way I can optimize an ORDER BY clause so that
> the server will not build an intermediate result set for sorting?
>
> Thanks for any advice.
>
> --
>
> Q Vincent Yin | Repeat
> vyin_at_cs.ubc.ca | delete(next->bug);
> (604) 876-9096 (H) | Until 0 = 1;
Vincent,

Oracle does not have a clustered index but it has better I think. Simply declare a cluster table with only one table and the cluster key being the column you want to order by your table. Then create an index on it as usual. This should answer your need.

Sylvie Bérubé
sberube_at_aircanada.ca Received on Sun Jan 12 1997 - 00:00:00 CST

Original text of this message

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