Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> to optimize or not to optimize

to optimize or not to optimize

From: Frank <franjoe_at_frisurf.no>
Date: Tue, 20 Mar 2001 19:41:21 +0100
Message-ID: <YzNt6.2735$mh4.178002@news3.oke.nextra.no>

Hi!
Isn't the optimizer able to see that this IN is containing constants (from SQL's pont of view)?
It should be possible to at least construct OR..OR..(if that is faster) ??

Frank

Greg Vitetzakis <greg_at_ostnet.com> wrote in message news:3ab7820f$1_at_news1...
> I think you are defeating the purpose of binding variables in the IN
 clause.
> Since the number of variables can and often will vary...The Oracle Parser
> will have to reparse the statement, so you will not be gaining any
> performance.
>
> In regards to performance, try to avoid using the IN clause whenever
> possible.
> It usually is very inefficient and cause Nested Loops. You should
> use the EXISTS statement instead.
>
>
> GV
>
> "Rene Nyffenegger" <rene.nyffenegger_at_audatex.KEINESPAM.ch> wrote in
 message
> news:996as2$730$1_at_news1.sunrise.ch...
> > Hi
> >
> > I am trying to bind values in the IN clause of an SQL statement
> > using OCI.
> >
> > select sth from stbl where sth_id in (:1, :2, :3)
> >
> > Almost needless to say that the count of parameters in the in clause
> > varies.
> >
> > Can that be achieved and if yes: how
> >
> > tia
> >
> > Rene
> >
> >
> >
>
>
Received on Tue Mar 20 2001 - 12:41:21 CST

Original text of this message

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