Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: Composite Index Order VS Query Order ?? , Tuning Docs URL ?.
Regarding question #1, if I understand it, you are asking if the order of the
WHERE clause conditions needs to match the order of the indexed columns. It
does not. WHERE-clause order is irrelevant in all but the most obscure cases.
Certainly it is irrelevant in this case. The best reason to worry about
WHERE-clause order is just that the order should be easy to read and understand
for the human developers maintaining the application - Oracle's optimizers can
(and do) perfectly well rearrange the order it checks those conditions to
enable the best execution plan and indexes it finds.
Dan Tow
650-858-1557
www.singingsql.com
Quoting "Ranjeesh K R." <ranjeeshk_at_infics.com>:
> Hi,
> I was working on optimising a piece of code which was taking 10hrs + to
> execute and all.So my queries are..
>
> #1) Saw a table where the "order of query" on the table and the "order of
> key"
> are different . For faster results shouldn't they be in the same order.
>
> for eg:
>
> Select ... where A.ID = ... and A.Name = ...
>
> The Key order on this table A NOW is Name & ID Order .
> Shouldn't they be in the order ID , Name ?..
>
>
...
-- Archives are at http://www.freelists.org/archives/oracle-l/ FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html -----------------------------------------------------------------Received on Tue Jul 13 2004 - 10:55:39 CDT
![]() |
![]() |