aboutsummaryrefslogtreecommitdiff
path: root/src/include/utils/catcache.h
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2002-03-06 20:49:46 +0000
committerBruce Momjian <bruce@momjian.us>2002-03-06 20:49:46 +0000
commit7ab746731812fb4574f04a7402eaa40d15e29720 (patch)
tree11883b3a5a44cf0401c3647599a3d1502c711623 /src/include/utils/catcache.h
parent5b5cef9abd92e6e17f78cbf2838ac898f3427255 (diff)
downloadpostgresql-7ab746731812fb4574f04a7402eaa40d15e29720.tar.gz
postgresql-7ab746731812fb4574f04a7402eaa40d15e29720.zip
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/include/utils/catcache.h')
-rw-r--r--src/include/utils/catcache.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/include/utils/catcache.h b/src/include/utils/catcache.h
index cf820e37b8f..034c061e7d4 100644
--- a/src/include/utils/catcache.h
+++ b/src/include/utils/catcache.h
@@ -13,7 +13,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: catcache.h,v 1.39 2002/03/03 17:47:56 tgl Exp $
+ * $Id: catcache.h,v 1.40 2002/03/06 20:49:46 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -40,8 +40,8 @@ typedef struct catcache
TupleDesc cc_tupdesc; /* tuple descriptor (copied from reldesc) */
int cc_reloidattr; /* AttrNumber of relation OID attr, or 0 */
int cc_ntup; /* # of tuples currently in this cache */
- int cc_size; /* # of hash buckets in this cache */
- int cc_nkeys; /* number of keys (1..4) */
+ int cc_nbuckets; /* # of hash buckets in this cache */
+ int cc_nkeys; /* # of keys (1..4) */
int cc_key[4]; /* AttrNumber of each key */
PGFunction cc_hashfunc[4]; /* hash function to use for each key */
ScanKeyData cc_skey[4]; /* precomputed key info for heap scans */