Shaping the use of Inner Join in leftjoin vs multiple left

I have a question about MySQL performance

Query1:

select departments.*, booth_feature.some_feature
from departments
left join booth on booth.dept_id = departments.dept_id
left join booth_feature  on  booth.booth_id=booth_feature.booth_id

Query2:

select departments.*, booth_feature.some_feature
from departments
left join (booth, booth_feature) on ( booth.dept_id = departments.dept_id and booth.booth_id=booth_feature.booth_id)

Assuming: a department may have several cabins

1 stand => 1 stand function

both department and stand tables are large tables.

Using the clarification, the first query seems better (it checks the stand before booth_feature), although the left join is usually more expensive than the inner join. It is right?

+3
source share
1 answer

booth_feature , , . "" , -, . - ( ).

, ( REF MYSQL EXPLAIN) ( ) (booth_features)

+1

All Articles