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: Performance with ORDER BY !!!

Re: Performance with ORDER BY !!!

From: Kai Poitschke <kai.poitschke_at_computer.org>
Date: Tue, 07 Dec 1999 18:24:17 +0100
Message-ID: <384D42C1.2A7B5CC9@computer.org>


Franz Mueller wrote:
>
> I know that you can add an index on the ORDER BY field. Then, with the
> hint /* +FIRST_ROWS */ you can force that the rows will be returned in
> already sorted order. This does not always solve the problem. Let's
> see the following example:
>
> SELECT .. FROM .. WHERE Field1=x ORDER BY Field2
> Index on The field used in Clause1 and index on Field1
>

How about creating an index on both fields (Field1, Field2) and changing the where condition to
...WHERE Field1=X AND FIELD2 IS NOT NULL

and using the index_asc hint ?

Just my 2c
Kai

--
$f

Unix, WinNT and MS-DOS. The Good, The Bad and The Ugly. Kai Poitschke MailTo:kai.poitschke[at]computer.org Date/Time: $d/$t Received on Tue Dec 07 1999 - 11:24:17 CST

Original text of this message

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