There are many disputes about what should use developers in sql queries. I guess I ask old question :) Buy can somebody completely explain what is big difference in these two methods? is there maybe some misunderstanding in database theory of programmers? Can somebody give good article about this question or just say - what is a difference in these methods in PosgreSQL? :)
+1
A:
Did you mean SELECT * FROM table1, table2 vs SELECT * FROM table1 JOIN table2 ON condition?
PostgreSQL optimizer makes this queries run with the same speed, but JOIN is more transparent and usable. Also, you can use LEFT/RIGHT JOIN.
Андрей Костенко
2010-06-28 16:35:23
The first version is also subject to accidental cross joins and the second is much more maintainable.
HLGEM
2010-06-28 17:26:24
+1
A:
In the PostgreSQL documentation there is a related topic. Explicit joins can give you more control over the execution order of statements using the join_collapse_limit GUC. Take a look at this page.
There are also all the other already mentioned advantages in readability and maintainability.
Diogo Biazus
2010-06-30 23:12:51