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
Subject: Re: 7.4 vs 7.3 ( hash join issue )
Date: Wed, 22 Sep 2004 13:56:34 -0400
Message-ID: <14106.1095875794@sss.pgh.pa.us> (raw)
In-Reply-To: <87sm9acih3.fsf@stark.xeocode.com>
References: <Pine.LNX.4.44.0409221717010.9559-100000@zigo.dhs.org>
<87sm9acih3.fsf@stark.xeocode.com>
Greg Stark <gsstark@mit.edu> writes:
> No, postgres didn't do things in reverse order. It hashed the empty table and
> then went ahead and checked every record of the non-empty table against the
> empty hash table.
> Reading the code there's no check for this, and it seems like it would be a
> useful low-cost little optimization.
Yeah, I was just looking at doing that.
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 :-(
> I think postgres normally hashes the table it thinks is smaller,
Right, it will prefer to put the physically smaller table (estimated
width*rows) on the inside.
regards, tom lane
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
Subject: Re: 7.4 vs 7.3 ( hash join issue )
In-Reply-To: <14106.1095875794@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