Re: optimizing where clause?

From: Dirk Bellemans <Dirk.Bellemans_at_skynet.belgium>
Date: Tue, 16 Jan 2001 20:50:59 +0100
Message-ID: <9427tl$vqn$4_at_news1.skynet.be>


In RULE base optimizer mode, the tables are processed from right to left. In CHOOSE or COST based mode, you can give the hint /*+ ORDERED */ to process the tables from left to right, but be warned that sometimes the optimizer can be quite stubborn to refuse following your hints. When you don't use hints, all depents on the statistics. You can perform an analyze ESTIMATE to set these right before you do perform the query, but not in all circumstances.

dirkske.

<pehaw_at_my-deja.com> wrote in message news:94143s$7vo$1_at_nnrp1.deja.com...
> I always thought that Oracle processed the tables in the FROM clause in
> reverse order (ie the table listed first is the last one to be used by
> Oracle). The WHERE clause should list the tables in the order in which
> you want to process the information. (ie opposite to the FROM clause).
>
>
> Although I may be wrong.....?
>
> In article <940uaq$2tk$1_at_nnrp1.deja.com>,
> sigdock_at_my-deja.com wrote:
> > AFAIK, the last one will be evaluated first. This means that the most
> > selective clause should be put at the end. However, this only works if
> > your OPTIMIZER_MODE is set to RULE or to CHOOSE and the database is
 not
> > analyzed.
> >
> > h.t.h.
> >
> > BertJan Meinders
> > Oracle DBA
> > ASR-ICT
> >
> > In article <940mvf$dp7$1_at_SOLAIR2.EUnet.yu>,
> > "Sinisa" <popsin_at_eunet.yu> wrote:
> > > Hi,
> > >
> > > I have one question:
> > >
> > > if I have many filters in where clause joined with AND operator:
> > >
> > > SELECT * FROM bla, bla
> > > WHERE something = a
> > > AND something = b
> > > AND something = c
> > >
> > > which one will be executed first: the first one or the last one.
> > > I want to optimize this query but I don't know which one to put
 first. I
> > > know that the most restrictive filter should be executed first, but
 I
 don't
> > > know in which order will Oracle execute them.
> > >
> > > Sinisa
> > >
> > >
> >
> > Sent via Deja.com
> > http://www.deja.com/
> >
>
>
> Sent via Deja.com
> http://www.deja.com/
Received on Tue Jan 16 2001 - 20:50:59 CET

Original text of this message