Would it be faster to join a given select this way
select ...
join table1
on condition1
join table2
on condition2
then this
select ...
join table1
join table2
on condition1
and condition2
because you keep the temp-tables smaller?
(Let us assume: condition1 has nothing to do with table2.)
In theory, filter conditions should be stated “as soon as possible”, that is, option 1 may perform better.
In practice, most of the time, the SQL parser will optimize either version to the same execution plan. That is, unless your conditions are really twisted, or
table1ortable2are actually subqueries.If you have actual queries to play with, check the execution plan:
EXPLAIN [your query here](sorry, it is hard to be more specific if you don’t feed us with more… specifics)