Archives of the TeradataForum
Message Posted: Thu, 23 Apr 2015 @ 11:41:53 GMT
<-- Anonymously Posted: Wednesday, April 22, 2015 17:10 -->
What is the performance impact of using NOT IN clause vs <> conditions clubbed together by AND condition ?
For e.g. I have the following 2 queries -
select * from Tab1 where Store_ID NOT IN ('A', 'B'); select * from Tab1 where Store_ID <> 'A'AND Store_ID <> 'B'; **Store_Id is the Primary Index of the table.
I ran the explain on both the queries and found that the plans were exactly the same. I believe that since its a non-equality condition then the query will result in a FTS anyway (for both instances).. Why is it that it is recommended that NOT IN clauses be avoided in queries ?
|Copyright 2016 - All Rights Reserved|
|Last Modified: 27 Dec 2016|