Re: Combining hash values - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Combining hash values
Date
Msg-id 6883.1470065235@sss.pgh.pa.us
Whole thread Raw
In response to Re: Combining hash values  (Dean Rasheed <dean.a.rasheed@gmail.com>)
Responses Re: Combining hash values
List pgsql-hackers
Dean Rasheed <dean.a.rasheed@gmail.com> writes:
> On that subject, while looking at hashfunc.c, I spotted that
> hashint8() has a very obvious deficiency, which causes disastrous
> performance with certain inputs:

Well, if you're trying to squeeze 64 bits into a 32-bit result, there
are always going to be collisions somewhere.

> I'd suggest using hash_uint32() for values that fit in a 32-bit
> integer and hash_any() otherwise.

Perhaps, but this'd break existing hash indexes.  That might not be
a fatal objection, but if we're going to put users through that
I'd like to think a little bigger in terms of the benefits we get.
I've thought for some time that we needed to move to 64-bit hash function
results, because the size of problem that's reasonable to use a hash join
or hash aggregation for keeps increasing.  Maybe we should do that and fix
hashint8 as a side effect.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: PostgreSQL 10 kick-off
Next
From: Tom Lane
Date:
Subject: New version numbering practices