Thanks to visit codestin.com
Credit goes to postgrespro.com

Re: new hashing function - Mailing list pgsql-hackers

From Tom Lane
Subject Re: new hashing function
Date
Msg-id [email protected]
Whole thread Raw
In response to new hashing function  (Neil Conway <[email protected]>)
List pgsql-hackers
Neil Conway <[email protected]> writes:
> I've implemented Bob Jenkin's hash function for PostgreSQL; more
> information on the hash function can be found at
> http://burtleburtle.net/bob/hash/doobs.html

One other thought --- presently, catcache.c is careful to use a prime
size (257) for its hash tables, so that reducing the raw hash value
mod 257 will allow all bits of the hash to contribute to determining
the hash bucket number.  This is necessary because of the relatively
poor randomness of the hash functions.  Perhaps with Jenkins' function
we could dispense with that, and use a fixed power-of-2 size so that the
division becomes a simple bit masking.  On machines with slow integer
division, this could be a nice speedup.  Wouldn't help for hash indexes
or joins though, since they don't use constant hashtable sizes.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: new hashing function
Next
From: Neil Conway
Date:
Subject: Re: new hashing function