> Can somebody comment on using EXISTS vs. IN in a subselect? I have
> some statements with subselects, and I'd like to understand the
> ramifications of choosing EXISTS or IN.
We have some brain-damaged code that is faster with EXISTS than IN.
With IN, the subquery is evaluated and the result put in a temp
relation. Every test for IN sequentially scans the subquery result
looking for a match. EXISTS uses an index on the subquery result. Not
sure why we can't just fix this, but I don't understand enough to know
the reason. People who do understand say there is no good solution
until we redesign the query tree in 7.1.
--
Bruce Momjian | http://www.op.net/~candle
maillist@candle.pha.pa.us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026