Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Performance with ORDER BY !!!
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