Re: Using bind variables for multiple values
Date: Mon, 24 Nov 2008 07:31:31 -0800 (PST)
Message-ID: <6d61b712-b97f-41e9-8b51-9387f3f3d13b@y18g2000yqn.googlegroups.com>
On Nov 24, 4:12 pm, Shakespeare <what..._at_xs4all.nl> wrote:
> Robert Klemme schreef:
>
> > I wondered: why is it that the join version does a full table scan but
> > the IN ( subselect ) version does not?
>
> From a logical point of view I would say: because what you ask for is
> something different:
> - For an IN clause, 1 occurence is enough to decide if there's a match
> - For a join, you specifically ask for all matching occurences.
Yes, that's certainly the major difference. But why does this lead the CBO to suddenly change its idea of the table variable's cardinality? I could not find anything in the trace that would explain this. Of course it could be that the CBO simply does not trace that bit of information...
Kind regards
robert Received on Mon Nov 24 2008 - 09:31:31 CST