diff options
| author | Bruce Momjian <bruce@momjian.us> | 2002-03-06 20:49:46 +0000 |
|---|---|---|
| committer | Bruce Momjian <bruce@momjian.us> | 2002-03-06 20:49:46 +0000 |
| commit | 7ab746731812fb4574f04a7402eaa40d15e29720 (patch) | |
| tree | 11883b3a5a44cf0401c3647599a3d1502c711623 /src/backend/access/hash/hash.c | |
| parent | 5b5cef9abd92e6e17f78cbf2838ac898f3427255 (diff) | |
| download | postgresql-7ab746731812fb4574f04a7402eaa40d15e29720.tar.gz | |
I've attached a patch which implements Bob Jenkin's hash function for
PostgreSQL. This hash function replaces the one used by hash indexes and
the catalog cache. Hash joins use a different, relatively poor-quality
hash function, but I'll fix that later.
As suggested by Tom Lane, this patch also changes the size of the fixed
hash table used by the catalog cache to be a power-of-2 (instead of a
prime: I chose 256 instead of 257). This allows the catcache to lookup
hash buckets using a simple bitmask. This should improve the performance
of the catalog cache slightly, since the previous method (modulo a
prime) was slow.
In my tests, this improves the performance of hash indexes by between 4%
and 8%; the performance when using btree indexes or seqscans is
basically unchanged.
Neil Conway <neilconway@rogers.com>
Diffstat (limited to 'src/backend/access/hash/hash.c')
| -rw-r--r-- | src/backend/access/hash/hash.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/backend/access/hash/hash.c b/src/backend/access/hash/hash.c index c98ca9bd95..ebad04c9fe 100644 --- a/src/backend/access/hash/hash.c +++ b/src/backend/access/hash/hash.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/hash/hash.c,v 1.54 2002/03/02 21:39:16 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/hash/hash.c,v 1.55 2002/03/06 20:49:37 momjian Exp $ * * NOTES * This file contains only the public interface routines. @@ -165,9 +165,6 @@ hashinsert(PG_FUNCTION_ARGS) char *nulls = (char *) PG_GETARG_POINTER(2); ItemPointer ht_ctid = (ItemPointer) PG_GETARG_POINTER(3); -#ifdef NOT_USED - Relation heapRel = (Relation) PG_GETARG_POINTER(4); -#endif InsertIndexResult res; HashItem hitem; IndexTuple itup; @@ -333,7 +330,6 @@ hashendscan(PG_FUNCTION_ARGS) /* * hashmarkpos() -- save current scan position - * */ Datum hashmarkpos(PG_FUNCTION_ARGS) |
