Bruno Wolff III <[EMAIL PROTECTED]> writes:
> I have two related questions about joins.
> One is that if you don't group with parenthesis, what order are they
> done in?

Left to right.  A JOIN B JOIN C == (A JOIN B) JOIN C.

> Will the optimizer be able to pick the better order of the two possible
> orders in the following example or do I need to try both and pick one?

The latter.  See
http://www.ca.postgresql.org/users-lounge/docs/7.1/postgres/explicit-joins.html

This behavior is not graven on stone tablets (at least not for inner
joins), but it was easy to do and is useful for cases where you *don't*
want the planner to try all possible join orders.  So it'll probably
stay like that at least for a release or two, until we have enough field
experience to see whether people like it this way or not.

                        regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly

Reply via email to