Re: Help with nested loop left join performance - Mailing list pgsql-performance

From Tom Lane
Subject Re: Help with nested loop left join performance
Date
Msg-id 11673.1140620645@sss.pgh.pa.us
Whole thread Raw
In response to Re: Help with nested loop left join performance  (Richard Huxton <dev@archonet.com>)
List pgsql-performance
Richard Huxton <dev@archonet.com> writes:
> George Woodring wrote:
>>      FROM
>>          settop_billing
>>      LEFT OUTER JOIN
>>          (dhct JOIN dhct_davic USING(mac))
>>      USING
>>          (mac)
>>      WHERE
>>          region='GTown1E' AND node='1E012'

> With 7.4 I seem to remember that explicit JOINs force the evaluation
> order, but I'm not if even later versions will rewrite your query. It's
> too early in the morning for me to figure out if it's safe in all cases.

CVS HEAD can re-order left joins in common cases, but no existing
release will touch the ordering of outer joins at all.

It's impossible to tell here which tables the WHERE-clause restrictions
actually bear on, so there's no way to say whether a different join
order would help.  My guess though is that George may be stuck --- in
general you can't move a join into or out of the right side of a left
join without changing the answers.

            regards, tom lane

pgsql-performance by date:

Previous
From: Richard Huxton
Date:
Subject: Re: --pls reply ASAP
Next
From: Brendan Duddridge
Date:
Subject: Re: LIKE query on indexes