IN vs. JOIN with large rowsets

前端 未结 12 1753
天命终不由人
天命终不由人 2020-11-30 20:45

I\'m wanting to select rows in a table where the primary key is in another table. I\'m not sure if I should use a JOIN or the IN operator in SQL Server 2005. Is there any si

12条回答
  •  我在风中等你
    2020-11-30 21:26

    Observe the execution plan for both types and draw your conclusions. Unless the number of records returned by the subquery in the "IN" statement is very small, the IN variant is almost certainly slower.

提交回复
热议问题