SQL Filter criteria in join criteria or where clause which is more efficient

后端 未结 9 1610
攒了一身酷
攒了一身酷 2020-12-03 02:47

I have a relatively simple query joining two tables. The \"Where\" criteria can be expressed either in the join criteria or as a where clause. I\'m wondering which is more

9条回答
  •  时光取名叫无心
    2020-12-03 03:17

    Become familiar with the Estimated Execution Plan in SQL Management Studio!! Like others have said, you're at the mercy of the analyzer no matter what you do so trust its estimates. I would guess the two you provided would produce the exact same plan.

    If it's an attempt to change a development culture, pick the one that gives you a better plan; for the ones that are identical, follow the culture

    I've commented this on other "efficiency" posts like this one (it's both sincere and sarcastic) -- if this is where your bottlenecks reside, then high-five to you and your team.

提交回复
热议问题