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.
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.