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

From Greg Stark
Subject Re: Horribly slow hash join
Date
Msg-id 873c719476.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:

> 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

pgsql-performance by date:

Previous
From: Dennis Bjorklund
Date:
Subject: Re: Horribly slow hash join
Next
From: Tom Lane
Date:
Subject: Re: Horribly slow hash join