Usenet.com

www.Usenet.com

Group Index

Comp Thread Archive from Usenet.com

<-- __Chronological__ --> <-- __Thread__ -->

Re: IN vs EXISTS - which is better?



>> Does anybody know if this is true? <<

It depends.  Older versions of DB2 used to use indexes for EXISTS()
predicates and they were quite a bit faster than the IN() predicate
that mateiralized a temp table on the fly.  Since a myth was born. 
These days, a good optimizer will find the best way regardless of the
predicate.  I'd say use the one which is easier to read, unless you
find a real difference by testing both.



<-- __Chronological__ --> <-- __Thread__ -->


Usenet.com



Please check out one of the premium Usenet Newsgroup Service Providers below for access to Usenet.