pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Richard Huxton <dev@archonet.com>
Cc: George Woodring <george.woodring@iglass.net>
Cc: pgsql-performance@postgresql.org
Subject: Re: Help with nested loop left join performance
Date: Wed, 22 Feb 2006 10:04:05 -0500
Message-ID: <11673.1140620645@sss.pgh.pa.us> (raw)
In-Reply-To: <43FC30FC.3080800@archonet.com>
References: <1B1B254441DB31448BD34C5BD73B0B8B28FBF6@PHOENIX.istructure.com>
	<43FC30FC.3080800@archonet.com>

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



view thread (3+ messages)

Message-ID: <11673.1140620645@sss.pgh.pa.us>
Permalink:  ../11673.1140620645@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/11673.1140620645@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, dev@archonet.com, george.woodring@iglass.net
  Subject: Re: Help with nested loop left join performance
  In-Reply-To: <11673.1140620645@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox