Left JOIN faster or Inner Join faster?

后端 未结 4 1972
不思量自难忘°
不思量自难忘° 2021-01-02 03:06

So... which one is faster (NULl value is not an issue), and are indexed.

SELECT * FROM A
  JOIN B b ON b.id = a.id
  JOIN C c ON c.id = b.id 
 WHERE A.id = \         


        
4条回答
  •  情深已故
    2021-01-02 03:18

    Use EXPLAIN to see the query plan. It's probably the same plan for both cases, so I doubt it makes much difference, assuming there are no rows that don't match. But these are two different queries so it really doesn't make sense to compare them - you should just use the correct one.

    Why not use the "INNER JOIN" keyword instead of "LEFT JOIN"?

提交回复
热议问题