David Newall <davidn-postgres(at)rebel(dot)net(dot)au> writes:
> It's clearly an optimisation issue:
No, it's an outer-join-semantics issue.
> select * from a join b optimises differently to select * from a join
> (select * from b) as b
The above claim is provably false. Now, if you throw in some more
tables and sprinkle in a LEFT JOIN instead of just JOIN here and there,
you can get different plans --- but the semantics are not necessarily
the same, either.
regards, tom lane