0

Does the join using a comma really use Cartesian product which makes it less optimized than an INNER JOIN because it has to go through all combinations first before executing the WHERE clause?

JOIN using WHERE clause:

SELECT sample
FROM table1, table2
WHERE table1.key = table2.key

INNER JOIN:

SELECT sample
FROM table1 INNER JOIN table2 ON table1.key = table2.key
  • 1
    Doubt it but I know which is easier to understand and maintain and therefore more optimal in that sense in my view in bigger and complex queries. – P.Salmon Jan 10 '21 at 12:37
  • 1
    The two queries lead to the same execution plan. But comma-separated joins are more prone to errors, are less readable and cannot easily get converted into outer joins. They are a thing of the past (the 1980s) when there were no explicit joins yet. Don't use them. – Thorsten Kettner Jan 10 '21 at 17:26

0 Answers0