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: Sort Algorithm

Re: Sort Algorithm

From: Joe <joe_at_bftsi0.UUCP>
Date: 1998/02/27
Message-ID: <9378@bftsi0.UUCP>#1/1

In article <34F7101F.7056307A_at_access-laserpress.com>, kfleming_at_access-laserpress.com (Kevin P. Fleming) writes:

> If the column(s) being ORDERed are indexed using a traditional B-tree index,
> then the data will most likely be read from the table in presorted order.
> This is almost always the most efficient implementation of the ORDER BY
> clause.
 

> If Oracle has to do the sort without the help of indexes, it may be possible
> for you to do the sort yourself faster if your client station is
> significantly more powerful than the server.

Since this is crossposted to comp.databases.theory, =) I wonder if Oracle or any other DBMS uses radix sorting when the data isn't already indexed in the desired order. Isn't binsort, a form of radix sorting, O(n)? It should be possible to transform most any data into a form suitable for an O(n) binsort. For example, floating-point numbers could be represented by the (inverted) sign bit, followed by the exponent, followed by the mantissa. The binsort could then only consider the binary representation without needing to care about data types. It could be pretty RAMintensive,  however...

-- 
Joe Foster <mailto:jfoster_at_ricochet.net> or <mailto:joe_at_bftsi0.gate.net>
WARNING: I cannot be held responsible for the above        They're   coming  to
because  my cats have  apparently  learned to type.        take me away, ha ha!
Received on Fri Feb 27 1998 - 00:00:00 CST

Original text of this message

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