Subject Re: [firebird-support] Re: Why does this query take forever in FB?!?!
Author Jerome Bouvattier
heLen,

> If you are talking about Firebird here, not IB, then IN (<select list>)
> resolves to a WHERE EXISTS(), which does use an index, if there is one.
It
> doesn't form an IN() list and it doesn't do an item-by-item
> comparison. That makes it very efficient for the kind of search IN()
> should be used for (WHERE-limited sets of up to a few hundred members) and
> potentially still slow if you apply it to a huge set.

I understand, but the change Arno's speaking about would make statements
with limited sub-selects even more efficient (close to an explicit IN with
hardcoded values, provided the sub-select can use index of course). For the
cases where the sub-select potentially returns "too big" resultsets, then
you still have WHERE EXISTS().

Am I missing something ?

--
Jerome