diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2002-11-06 22:31:24 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2002-11-06 22:31:24 +0000 |
commit | 2103b7baa26fe25cc2b5bee802028caeabb28113 (patch) | |
tree | f7516bbb3b18fca352fd638d567b2b0bf3a5a0bd /src/backend/executor/nodeHash.c | |
parent | fc9814d17e7701bac198c99f8ab9f67c8468797f (diff) | |
download | postgresql-2103b7baa26fe25cc2b5bee802028caeabb28113.tar.gz postgresql-2103b7baa26fe25cc2b5bee802028caeabb28113.zip |
Phase 2 of hashed-aggregation project. nodeAgg.c now knows how to do
hashed aggregation, but there's not yet planner support for it.
Diffstat (limited to 'src/backend/executor/nodeHash.c')
-rw-r--r-- | src/backend/executor/nodeHash.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/src/backend/executor/nodeHash.c b/src/backend/executor/nodeHash.c index 8bb5bde84c0..57faf0622cb 100644 --- a/src/backend/executor/nodeHash.c +++ b/src/backend/executor/nodeHash.c @@ -7,7 +7,8 @@ * Portions Copyright (c) 1994, Regents of the University of California * * - * $Id: nodeHash.c,v 1.66 2002/09/04 20:31:18 momjian Exp $ + * IDENTIFICATION + * $Header: /cvsroot/pgsql/src/backend/executor/nodeHash.c,v 1.67 2002/11/06 22:31:23 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -31,8 +32,6 @@ #include "utils/lsyscache.h" -static uint32 hashFunc(Datum key, int typLen, bool byVal); - /* ---------------------------------------------------------------- * ExecHash * @@ -532,7 +531,7 @@ ExecHashGetBucket(HashJoinTable hashtable, /* * We reset the eval context each time to reclaim any memory leaked in - * the hashkey expression or hashFunc itself. + * the hashkey expression or ComputeHashFunc itself. */ ResetExprContext(econtext); @@ -550,9 +549,9 @@ ExecHashGetBucket(HashJoinTable hashtable, bucketno = 0; else { - bucketno = hashFunc(keyval, - (int) hashtable->typLen, - hashtable->typByVal) + bucketno = ComputeHashFunc(keyval, + (int) hashtable->typLen, + hashtable->typByVal) % (uint32) hashtable->totalbuckets; } @@ -622,16 +621,16 @@ ExecScanHashBucket(HashJoinState *hjstate, } /* ---------------------------------------------------------------- - * hashFunc + * ComputeHashFunc * - * the hash function for hash joins + * the hash function for hash joins (also used for hash aggregation) * * XXX this probably ought to be replaced with datatype-specific * hash functions, such as those already implemented for hash indexes. * ---------------------------------------------------------------- */ -static uint32 -hashFunc(Datum key, int typLen, bool byVal) +uint32 +ComputeHashFunc(Datum key, int typLen, bool byVal) { unsigned char *k; @@ -681,7 +680,7 @@ hashFunc(Datum key, int typLen, bool byVal) } else { - elog(ERROR, "hashFunc: Invalid typLen %d", typLen); + elog(ERROR, "ComputeHashFunc: Invalid typLen %d", typLen); k = NULL; /* keep compiler quiet */ } } |