Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: to optimize or not to optimize
Correct, although the more modern
option in 8 is the INLIST ITERATOR
rather than the concatenated OR
-- Jonathan Lewis Yet another Oracle-related web site: http://www.jlcomp.demon.co.uk Practical Oracle 8i: Building Efficient Databases Publishers: Addison-Wesley Reviews at: http://www.jlcomp.demon.co.uk/book_rev.html Frank wrote in message ...Received on Sat Mar 31 2001 - 06:05:31 CST
>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
>> >
>> >
>> >
>>
>>
>
>
![]() |
![]() |