Re: inlist iterator algorithm

  • From: Michael Moore <michaeljmoore@xxxxxxxxx>
  • To: oracledbaquestions@xxxxxxxxx
  • Date: Wed, 6 Jul 2011 13:03:33 -0700

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@xxxxxxxxx>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?
>

Other related posts: