Re: Horribly slow hash join

From: Greg Stark <gsstark(at)mit(dot)edu>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Jim C(dot) Nasby" <jim(at)nasby(dot)net>, pgsql-performance(at)postgresql(dot)org
Subject: Re: Horribly slow hash join
Date: 2004-04-17 23:04:39
Message-ID: 878ygu8auw.fsf@stark.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance


Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:

> We could change the hash function, perhaps, but then we'd just have
> different cases where there's a problem ... hashing will always fail on
> *some* set of inputs.

Sure, but completely ignoring part of the input seems like an unfortunate
choice of hash function.

> (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 and at least ensures
that all the bits are taken into account.

--
greg

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Mark Kirkwood 2004-04-18 03:35:58 Re: Poor performance of group by query
Previous Message Marcos Martínez (R) 2004-04-17 20:35:09 Re: Horribly slow hash join