Re: new hashing function

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Neil Conway <nconway(at)klamath(dot)dyndns(dot)org>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: new hashing function
Date: 2002-03-03 18:48:52
Message-ID: 5621.1015181332@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Neil Conway <nconway(at)klamath(dot)dyndns(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Neil Conway 2002-03-03 19:17:54 Re: new hashing function
Previous Message Tom Lane 2002-03-03 17:31:13 Re: new hashing function