Subject Re: [firebird-support] About EXISTS predicate
Author Helen Borrie
>> Just one simple doubt, Is there any limitation for EXISTS predicate too, as
>> we have for IN predicate for 1500 values ?
>
At 09:22 PM 16/09/2009, Thomas Steinmaurer wrote:

>No, because EXISTS is a different construct than IN, which does not
>expect a list of input values.

There is more to it, as well. ;-)

The 1499 limit applies to an IN() predicate of the form

IN (const1, const2, ....)

The limit doesn't apply when the argument is a subquery.

Note, too:

The engine actually resolves the subquery form to EXISTS(), because it is logically equivalent and is a far more economical search than IN(). However, this does *NOT* apply to a NOT IN() predicate. While NOT IN(sq) AND NOT EXISTS() are equivalent in many situations, there are some situations where they return different results. (I can't think of an example; I just know that it is proven somewhere that this can be so.)

./heLen