查询最佳实践

时间:2018-08-02 05:51:40

标签: sql tsql

两次查询中的最佳做法 和运行sql server的速度

SELECT *
FROM AppInfra.Person 
INNER JOIN  Gnr.PersonAddress ON PersonAddress.PersonId = Person.Id 
                             AND PersonAddress.AddressTypeId = 2

OR

SELECT *
FROM AppInfra.Person 
INNER JOIN Gnr.PersonAddress ON PersonAddress.PersonId = Person.Id
WHERE PersonAddress.AddressTypeId = 2

2 个答案:

答案 0 :(得分:1)

认为这两种情况之间确实没有可测量的性能差异。

http://www.eggheadcafe.com/conversation.aspx?messageid=29145383&threadid=29145379

答案 1 :(得分:0)

因为它是{{1}},所以不会有什么大不同。

请参阅: SQL Filter criteria in join criteria or where clause which is more efficient