pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: josh@agliodbs.com
Cc: Lorraine.Dewey@companiongroup.com
Cc: pgsql-sql@postgresql.org
Subject: Re: Optomizing left outer joins
Date: Wed, 23 Apr 2003 22:37:38 -0400
Message-ID: <10221.1051151858@sss.pgh.pa.us> (raw)
In-Reply-To: <200304231149.32514.josh@agliodbs.com>
References: <ebfd27c8.0304210714.66e3ae75@posting.google.com>
	<200304231149.32514.josh@agliodbs.com>

Josh Berkus <josh@agliodbs.com> writes:
> FWIW, outer joins are slower than regular joins on all RDBMSs I've tested -- 
> often up to 5 times slower.   I'm not sure whether this is just the planner 
> restricitons inherent in an outer join, or whether this is something about 
> the required join algorithm itself.

There isn't anything fundamentally slower about left join vs plain join
(unless, perhaps, the left join has to generate a really large number
of null-extended rows that the plain join would not generate).  My money
is on the left join having prevented some optimization that could be
applied in the plain-join case.  But since we have not been shown any
exact details of the tables or the query, it's impossible to do more
than wager...

			regards, tom lane




view thread (5+ messages)

Message-ID: <10221.1051151858@sss.pgh.pa.us>
Permalink:  ../10221.1051151858@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/10221.1051151858@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, josh@agliodbs.com, Lorraine.Dewey@companiongroup.com
  Subject: Re: Optomizing left outer joins
  In-Reply-To: <10221.1051151858@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