Friday, 15 June 2012

mysql - Two positions of ON clause: Which is faster? -



mysql - Two positions of ON clause: Which is faster? -

would faster bring together given select way

select ... bring together table1 on condition1 bring together table2 on condition2

then this

select ... bring together table1 bring together table2 on condition1 , condition2

because maintain temp-tables smaller?

(let assume: condition1 has nil table2.)

in theory, filter conditions should stated "as possible", is, alternative 1 may perform better.

in practice, of time, sql parser optimize either version same execution plan. is, unless conditions twisted, or table1 or table2 subqueries.

if have actual queries play with, check execution plan: explain [your query here]

(sorry, hard more specific if don't feed more... specifics)

mysql

No comments:

Post a Comment