Add support for cross-type hashing in hash index searches and hash joins.

Hashing for aggregation purposes still needs work, so it's not time to
mark any cross-type operators as hashable for general use, but these cases
work if the operators are so marked by hand in the system catalogs.
This commit is contained in:
Tom Lane
2007-01-30 01:33:36 +00:00
parent e8cd6f14a2
commit a635c08fa1
12 changed files with 240 additions and 82 deletions

View File

@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $PostgreSQL: pgsql/src/include/executor/hashjoin.h,v 1.43 2007/01/28 23:21:26 tgl Exp $
* $PostgreSQL: pgsql/src/include/executor/hashjoin.h,v 1.44 2007/01/30 01:33:36 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -102,12 +102,11 @@ typedef struct HashJoinTableData
/*
* Info about the datatype-specific hash functions for the datatypes being
* hashed. We assume that the inner and outer sides of each hashclause
* are the same type, or at least share the same hash function. This is an
* array of the same length as the number of hash keys.
* hashed. These are arrays of the same length as the number of hash join
* clauses (hash keys).
*/
FmgrInfo *hashfunctions; /* lookup data for hash functions */
FmgrInfo *outer_hashfunctions; /* lookup data for hash functions */
FmgrInfo *inner_hashfunctions; /* lookup data for hash functions */
bool *hashStrict; /* is each hash join operator strict? */
Size spaceUsed; /* memory space currently used by tuples */

View File

@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $PostgreSQL: pgsql/src/include/executor/nodeHash.h,v 1.43 2007/01/28 23:21:26 tgl Exp $
* $PostgreSQL: pgsql/src/include/executor/nodeHash.h,v 1.44 2007/01/30 01:33:36 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -31,6 +31,7 @@ extern void ExecHashTableInsert(HashJoinTable hashtable,
extern bool ExecHashGetHashValue(HashJoinTable hashtable,
ExprContext *econtext,
List *hashkeys,
bool outer_tuple,
bool keep_nulls,
uint32 *hashvalue);
extern void ExecHashGetBucketAndBatch(HashJoinTable hashtable,