updated hash functions for postgresql v1 - Mailing list pgsql-patches

From Kenneth Marshall
Subject updated hash functions for postgresql v1
Date
Msg-id 20071027201557.GW27320@it.is.rice.edu
Whole thread Raw
Responses Re: updated hash functions for postgresql v1  (Simon Riggs <simon@2ndquadrant.com>)
Re: updated hash functions for postgresql v1  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-patches
Dear PostgreSQL Developers,

This patch is a "diff -c" against the hashfunc.c from postgresql-8.3beta1.
It implements the 2006 version of the hash function by Bob Jenkins. Its
features include a better and faster hash function. I have included the
versions supporting big-endian and little-endian machines that will be
selected based on the machine configuration. Currently, I have hash_any()
just a stub calling hashlittle and hashbig. In order to allow the hash
index to support large indexes (>10^9 entries), the hash function needs
to be able to provide 64-bit hashes.

The functions hashbig2/hashlittle2 produce 2 32-bit hashes that can be
used as a 64-bit hash value. I would like some feedback as to how best
to include 64-bit hashes within our current 32-bit hash infrastructure.
The hash-merge can simple use one of the 2 32-bit pieces to provide
the current 32-bit hash values needed. Then they could be pulled directly
from the hash index and not need to be recalculated at run time. What
would be the best way to implement this in a way that will work on
machines without support for 64-bit integers?

The current patch passes all the regression tests, but has a few warnings
for the different variations of the new hash function. Until the design
has crystalized, I am not going to worry about them and I want testers to
have access to the different functions. I am doing the initial patches
to the hash index code based on a 32-bit hash, but I would like to add the
64-bit hash support pretty early in the development cycle in order to
allow for better testing. Any thoughts would be welcome.

Regards,
Ken

Attachment

pgsql-patches by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Minor change to pg_dump docs
Next
From: Simon Riggs
Date:
Subject: Re: Autovacuum cancellation