How is IN different form EXISTS ?
-
IN executes the inner query for each row affected by the outer query and EXISTS executes the inner query only once irrespective of the outer query
-
IN executes the inner query only once irrespective of the outer query and EXISTS executes the inner query only once irrespective of the outer query
-
IN executes the inner query only once irrespective of the outer query and EXISTS executes the outer query for each row affected by the outer query
-
IN executes the inner query for each row affected by the outer query and EXISTS executes the outer query for each row affected by the outer query
The IN operator evaluates the subquery once to get a list of values, whereas EXISTS evaluates the subquery for each row processed by the outer query to check for the existence of a match.