mysql join by 2 ways - how it works? - which gives performance difference
There is a differences because:


In first query doing the following:


create temp table with data from A filtering out by CONDITION
create temp table with data from B
for each row in temp_A we traverse temp_B. In this case temp_A using FULL SCAN, temp_B access by index

Second query


For each row from A which fall under CONDITION we join with table B.



As you can see in second query there are "preloading" data into tables and scan works in different way.