Archives of the TeradataForum
Message Posted: Sat, 15 Dec 2001 @ 12:59:48 GMT
There's almost no difference in Teradata between IN and EXISTS, just EXPLAIN both, it's the same plan.
EXISTS/NOT EXISTS will produce the same plan, the only difference is the join type: Inclusion vs. exclusion.
IN/NOT IN will produce totally different plans, if the joined columns are NULLable, because the optimizer has to consider the three-way logic of NOT IN.
So in most cases it's better to use NOT EXISTS, especially because you don't have to think about NULLs.
|Copyright 2016 - All Rights Reserved|
|Last Modified: 28 Jun 2020|