Re: inlist iterator algorithm

From: Michael Moore <michaeljmoore_at_gmail.com>
Date: Wed, 6 Jul 2011 13:03:33 -0700
Message-ID: <CACpWLjNzLh+aMYZ2JbDUr4YDqbL7fXRo1BgtTEmnk4q5iHnekg_at_mail.gmail.com>



IN can be thought of as a shortcut for writing a series of ORs. NOT IN can be thought of as a shortcut for writing a series of ANDs. Consider this:
select dummy from dual where dummy not in ('z',null,'y');

Mike

On Wed, Jul 6, 2011 at 12:46 PM, Dba DBA <oracledbaquestions_at_gmail.com>wrote:

> I am not sure if this is documented. I am just curious.
>
> When Oracle does an inlist iterator, what is it doing under the cover. When
> I think "iterator", I think
>
> for i in array.start.. array.end
> run query(i)
> end loop;
>
> so if i have 5 values in the inlist, the query runs 5 times. once for each
> value in the inlist.
>
>
> My understanding
> 1. In, is a group of "or" statements
> 2. Or is the samething as a union all
>
>
> So when you do an or or a union all, you are running 2 queries.
>
> Is the inlist smarter than that?
>

--
http://www.freelists.org/webpage/oracle-l
Received on Wed Jul 06 2011 - 15:03:33 CDT

Original text of this message