Re: Oracle Logical Operator order of execution

From: joel garry <joel-garry_at_home.com>
Date: Tue, 1 Apr 2008 13:46:48 -0700 (PDT)
Message-ID: <ee0b31e9-debf-4885-beb3-e3af17ad18e4@s19g2000prg.googlegroups.com>


On Apr 1, 12:52 pm, Robert Klemme <shortcut..._at_googlemail.com> wrote:
> On 01.04.2008 21:43, Wally wrote:
>
> > On Apr 1, 2:32 pm, hpuxrac <johnbhur..._at_sbcglobal.net> wrote:
> >> On Apr 1, 3:05 pm, Wally <wallyr..._at_gmail.com> wrote:
> >> Oracle's cost based optimizer may not look at both sides of an or and
> >> there is no guarantee that it will always start on one side or the
> >> other.  Similarly with an "and" condition it may use one side or
> >> another to use indexes and then eliminate rows after they are returned
> >> as possible hits.
>
> To make it crystal clear: database do not have boolean short circuit
> evaluation.  A database might choose different access plans - even for
> the same SQL statement.  Something that does not happen in programming
> languages (there might be special cases but the statement holds true for
> most modern general purpose programming languages).
>
> Also, CPU cycles do not play the same role in a relational database as
> in programs.  Other major factors are IO, locking etc.
>
> >> If you are running a recent release you may want to get familiar with
> >> dbms_xplan.display
>
> Certainly good advice.
>
> Kind regards
>
>         robert

Also, it helps to normalize database design. The OP sure sounds like he has not eliminated attributes transitively dependent on the key (3rd normal form violation), at least.

jg

--
@home.com is bogus.
Take the skinheads bowling, take them bowling.
http://www.time.com/time/politics/article/0,8599,1726966,00.html
Received on Tue Apr 01 2008 - 15:46:48 CDT

Original text of this message