Re: [HACKERS] Hash Functions - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] Hash Functions
Date
Msg-id 31470.1502923267@sss.pgh.pa.us
Whole thread Raw
In response to Re: [HACKERS] Hash Functions  (Kenneth Marshall <ktm@rice.edu>)
List pgsql-hackers
Kenneth Marshall <ktm@rice.edu> writes:
> On Wed, Aug 16, 2017 at 05:58:41PM -0400, Tom Lane wrote:
>> ... In fact, on perusing the linked-to page
>> http://burtleburtle.net/bob/hash/doobs.html
>> Bob says specifically that taking b and c from this hash does not
>> produce a fully random 64-bit result.  He has a new one that does,
>> lookup3.c, but probably he hasn't tried to make that bit-compatible
>> with the 1997 algorithm.

> The updated hash functions that we currently use are based on Bob Jenkins
> lookup3.c and using b as the higher order bits is pretty darn good. I had
> lobbied to present the 64-bit b+c hash in the original work for similar
> reasons. We are definitely not using a lookup2.c version from 1997.

Oh --- I overlooked the bit about "Bob's 2006 update".  Really that
comment block should have been completely rewritten, rather than leaving
the original text there, especially since as it stands there are only
pointers to the old algorithm.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] Atomics for heap_parallelscan_nextpage()
Next
From: Andres Freund
Date:
Subject: Re: [HACKERS] Function to move the position of a replication slot