Subject RE: [firebird-support] in vs exist
Author Alan McDonald
> Hi,
>
> At December 18, 2003, 20:41, Alan McDonald wrote:
>
> > to quote Celko
> > "An EXISTS predicate can use indexes to find.. or fail, whereas the IN
> > predicate ofen has to build the results of the subquery in a
> working table"
>
> > not sure exactly how FB is optimised in this regard
>
> FB 1.5 will use an index if it exists, and also depending on what is
> in the IN predicate clause. I can't say precisely when an index would
> be used, because I've always used the EXISTS predicate and never came
> across a scenario where I had to use the IN predicate.
>
> --
> Best regards,
> Daniel Rail

I'm the other way (use IN) but I do only use it when I know that the result
of the IN subselect is small. It does not perform well when it is large.
Alan