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: Q: Conditions order in WHERE clause

Re: Q: Conditions order in WHERE clause

From: Darren John Capper <darren.capper_at_preci-spark.co.uk>
Date: Thu, 29 Jul 1999 11:20:20 +0100
Message-ID: <37A02AE3.D7092E19@preci-spark.co.uk>

huh wrote:
<snip>

> Does somebody know in what order are WHERE
> conditions evaluated? Is it determined or is the final
> decision made by an optimizer?
>
> E.g.:
> select ...
> from ...
> where A1.A = 5 -- c1
> and A1.B = A2.B -- c2
> and A1.C = A3.C (+) -- c3
> and A2.D is NULL -- c4
>
> Is this evaluated as it is written? :
> c1 first then c2, c3 and finally c4?

This is correct for the rules based optimiser, I'm not sure about the cost based. One interesting point though, I think that OR's are evaluated from the bottom up. Maybe one of the guru's can confirm this.

Regards,
Darren Received on Thu Jul 29 1999 - 05:20:20 CDT

Original text of this message

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