pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Greg Stark <gsstark@mit.edu>
Cc: Dennis Bjorklund <db@zigo.dhs.org>
Cc: Gaetano Mendola <mendola@bigfoot.com>
Cc: pgsql-performance@postgresql.org
Cc: pgsql-patches@postgresql.org
Subject: Re: [PERFORM] 7.4 vs 7.3 ( hash join issue )
Date: Wed, 22 Sep 2004 15:00:35 -0400
Message-ID: <17291.1095879635@sss.pgh.pa.us> (raw)
In-Reply-To: <87brfycfbf.fsf@stark.xeocode.com>
References: <Pine.LNX.4.44.0409221717010.9559-100000@zigo.dhs.org>
	<87sm9acih3.fsf@stark.xeocode.com>
	<14106.1095875794@sss.pgh.pa.us>
	<87brfycfbf.fsf@stark.xeocode.com>

Greg Stark <gsstark@mit.edu> writes:
>> It would also be interesting to prefetch one row from the outer table and fall
>> out immediately (without building the hash table) if the outer table is
>> empty.  This seems to require some contortion of the code though :-(

> Why is it any more complicated than just moving the hash build down lower?

Having to inject the consideration into ExecHashJoinOuterGetTuple seems
messy to me.

On reflection I'm not sure it would be a win anyway, for a couple of reasons.
(1) Assuming that the planner has gotten things right and put the larger
relation on the outside, the case of an empty outer relation and a
nonempty inner one should rarely arise.
(2) Doing this would lose some of the benefit from the optimization to
detect an empty inner relation.  If the outer subplan is a slow-start
one (such as another hashjoin), it would lose a lot of the benefit :-(

			regards, tom lane



view thread (13+ messages)  latest in thread

Message-ID: <17291.1095879635@sss.pgh.pa.us>
Permalink:  ../17291.1095879635@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/17291.1095879635@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, gsstark@mit.edu, db@zigo.dhs.org, mendola@bigfoot.com, pgsql-patches@postgresql.org
  Subject: Re: [PERFORM] 7.4 vs 7.3 ( hash join issue )
  In-Reply-To: <17291.1095879635@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