pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Dmitry Tkach <dmitry@openratings.com>
Cc: pgsql-sql <pgsql-sql@postgresql.org>
Subject: Re: Trouble with explicit joins
Date: Thu, 21 Oct 2004 19:32:13 -0400
Message-ID: <12900.1098401533@sss.pgh.pa.us> (raw)
In-Reply-To: <41783BC7.4040207@openratings.com>
References: <41783BC7.4040207@openratings.com>

Dmitry Tkach <dmitry@openratings.com> writes:
> I suppose, this is because the planner takes the order, in which the 
> tables appear in the explicit joins as some kind of a hint to how I want 
> that query to be executed,

It's not a "hint", it's a requirement.  In general, changing the order
in which outer joins are executed changes the results.

There are some cases in which it is safe to rearrange the order, but
determining this takes close analysis of the join conditions, and we
don't (yet) have any code to do that.  So the planner must be
conservative and take your join order as gospel.

			regards, tom lane



view thread (3+ messages)  latest in thread

Message-ID: <12900.1098401533@sss.pgh.pa.us>
Permalink:  ../12900.1098401533@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/12900.1098401533@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-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, dmitry@openratings.com
  Subject: Re: Trouble with explicit joins
  In-Reply-To: <12900.1098401533@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