In Complete SQL Mastery course, Mosh explained that EXISTS executes faster than IN Operator.
But my doubt is EXISTS is a correlated subquery which means the subquery executes for every row in the parent query until it matches a found(short circuits once match is found, but with the IN operator the subquery executes only once and after that it’s a values_from_subquery.contains(parent_query_row_value) which is a normal array.exists() operation. So I felt like the IN operator should execute similar to EXISTS operator as both are like using 2 for loops nested as an analogy.
Kindly share some insight on this…