Re: Horribly slow hash join - Mailing list pgsql-performance

From Greg Stark
Subject Re: Horribly slow hash join
Date
Msg-id 878ygu8auw.fsf@stark.xeocode.com
Whole thread Raw
In response to Re: Horribly slow hash join  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Horribly slow hash join
List pgsql-performance
Tom Lane <tgl@sss.pgh.pa.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

pgsql-performance by date:

Previous
From: Marcos Martínez(R)
Date:
Subject: Re: Horribly slow hash join
Next
From: Mark Kirkwood
Date:
Subject: Re: Poor performance of group by query