Re: new hashing function - Mailing list pgsql-hackers

From Tom Lane
Subject Re: new hashing function
Date
Msg-id 5621.1015181332@sss.pgh.pa.us
Whole thread Raw
In response to new hashing function  (Neil Conway <nconway@klamath.dyndns.org>)
List pgsql-hackers
Neil Conway <nconway@klamath.dyndns.org> 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