Filtering using the JOIN instead of WHERE

前端 未结 6 1094
别那么骄傲
别那么骄傲 2021-01-11 16:49

In SQL (MSSQL, Oracle, etc., whatever), when joining tables, what is the gain from adding a filter to the JOIN statement instead of having it in the WHERE clause?

i.

6条回答
  •  不知归路
    2021-01-11 16:51

    For INNER JOIN queries, the performance characteristics of these filters will depend on many factors - the size of the tables, indexing, the selectivity of the query, and other factors specific to the RDBMS on which the query is executed.

    In LEFT and RIGHT OUTER JOIN, the position of the filter matters much more than INNER JOIN, since affects whether it will be applied before (JOIN clause) or after (WHERE clause) the join is carried out.

提交回复
热议问题