From: Greg Stark <gsstark@mit.edu>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Greg Stark <gsstark@mit.edu>
Cc: Jim C. Nasby <jim@nasby.net>
Cc: pgsql-performance@postgresql.org
Subject: Re: Horribly slow hash join
Date: 18 Apr 2004 02:43:09 -0400
Message-ID: <873c719476.fsf@stark.xeocode.com> (raw)
In-Reply-To: <15053.1082259958@sss.pgh.pa.us>
References: <20040416154502.GF87362@nasby.net>
<450.1082133251@sss.pgh.pa.us>
<20040416164644.GH87362@nasby.net>
<808.1082135098@sss.pgh.pa.us>
<20040416172523.GJ87362@nasby.net>
<1263.1082138383@sss.pgh.pa.us>
<20040416184541.GK87362@nasby.net>
<10603.1082218095@sss.pgh.pa.us>
<878ygu8auw.fsf@stark.xeocode.com>
<15053.1082259958@sss.pgh.pa.us>
Tom Lane <tgl@sss.pgh.pa.us> writes:
> Greg Stark <gsstark@mit.edu> writes:
> > Tom Lane <tgl@sss.pgh.pa.us> writes:
> >> (Also, I have been harboring some notions of supporting cross-type hash
> >> joins for integer types, which will not work unless small int8 values hash
> >> the same as int4 etc.)
>
> > The obvious way to modify the hash function is to xor the high 32 bits with
> > the low 32 bits. That maintains the property you need
>
> No it doesn't ...
Eh? Oh, negative numbers? So low^high^sign.
I wonder if it makes sense to have check the hash distribution after
generating the table and if it's bad then throw it away and try again with a
different hash function. The "different hash function" would probably just be
a seed value changing. Probably way overkill though.
--
greg
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: gsstark@mit.edu, tgl@sss.pgh.pa.us, jim@nasby.net
Subject: Re: Horribly slow hash join
In-Reply-To: <873c719476.fsf@stark.xeocode.com>
* 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