Skip site navigation (1) Skip section navigation (2)

updated hash functions for postgresql v1

From: Kenneth Marshall <ktm(at)rice(dot)edu>
To: pgsql-patches(at)postgresql(dot)org
Cc: twraney(at)comcast(dot)net, neilc(at)samurai(dot)com
Subject: updated hash functions for postgresql v1
Date: 2007-10-27 20:15:58
Message-ID: 20071027201557.GW27320@it.is.rice.edu (view raw or flat)
Thread:
Lists: 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

Responses

pgsql-patches by date

Next:From: Hannu KrosingDate: 2007-10-27 21:20:47
Subject: Re: [PATCHES] Including Snapshot Info with Indexes
Previous:From: Bruce MomjianDate: 2007-10-27 16:09:14
Subject: Re: Minor change to pg_dump docs

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group