INNER JOINS in sql-select.html - Mailing list pgsql-docs

From Stefan Weiss
Subject INNER JOINS in sql-select.html
Date
Msg-id 1503129.DJSjvup6Wb@weyoun.foo.at
Whole thread Raw
Responses Re: INNER JOINS in sql-select.html
List pgsql-docs
Hi.

From <doc/html/sql-select.html>:
| A CROSS JOIN or INNER JOIN is a simple Cartesian product, the same
| as you get from listing the two items at the top level of FROM. CROSS
| JOIN is equivalent to INNER JOIN ON (TRUE), that is, no rows are
| removed by qualification. These join types are just a notational
| convenience, since they do nothing you couldn't do with plain FROM
| and WHERE.

Is there really no difference between these two queries?

SELECT blarg
  FROM ta, tb, tc, [...]
 WHERE ta.foo = tb.bar
   AND tb.bar = tc.baz
   AND [...]

SELECT blarg
  FROM ta
  JOIN tb ON tb.bar = ta.foo
  JOIN tc ON tc.baz = tb.bar
  JOIN [...]

I thought that by using the second form, you would be able to do
'explicit' joins, effectivly telling the planner in which order to
join multiple tables (in case you have to join 10+ tables)?


cheers,
stefan

pgsql-docs by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] 7.4 compatibility question
Next
From: Tom Lane
Date:
Subject: Re: INNER JOINS in sql-select.html