In what order does execution on WHERE and ON clauses work?

后端 未结 4 735
隐瞒了意图╮
隐瞒了意图╮ 2021-01-23 16:41

I was reading this page about APPLY:

http://sqlblog.com/blogs/alexander_kuznetsov/archive/2009/07/07/using-cross-apply-to-optimize-joins-on-between-conditions.aspx

4条回答
  •  盖世英雄少女心
    2021-01-23 17:17

    The second query is faster why you are limiting the scope of the join.

    First query: A join B

    Second query: A join subset(B)

    As subset(B) < B itself there are a lot less matches to scan for.

    And that leads to the question: the column used in that join got a index? (Probably not or the speeds cannot differ a lot)

提交回复
热议问题