diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2003-06-22 22:04:55 +0000 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2003-06-22 22:04:55 +0000 |
| commit | bff0422b6c8f65b2f8210d8690a7f63f8d6e2782 (patch) | |
| tree | a3ec649b7c6251efdae2be1b923462979ad7184e /src/include/nodes/execnodes.h | |
| parent | 0dda75f6eb4bb9d65a7c2ad729fbf21d616c1bb1 (diff) | |
| download | postgresql-bff0422b6c8f65b2f8210d8690a7f63f8d6e2782.tar.gz | |
Revise hash join and hash aggregation code to use the same datatype-
specific hash functions used by hash indexes, rather than the old
not-datatype-aware ComputeHashFunc routine. This makes it safe to do
hash joining on several datatypes that previously couldn't use hashing.
The sets of datatypes that are hash indexable and hash joinable are now
exactly the same, whereas before each had some that weren't in the other.
Diffstat (limited to 'src/include/nodes/execnodes.h')
| -rw-r--r-- | src/include/nodes/execnodes.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/include/nodes/execnodes.h b/src/include/nodes/execnodes.h index 68a3bb9b1c..47879296c0 100644 --- a/src/include/nodes/execnodes.h +++ b/src/include/nodes/execnodes.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: execnodes.h,v 1.98 2003/05/28 16:04:00 tgl Exp $ + * $Id: execnodes.h,v 1.99 2003/06/22 22:04:55 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -353,6 +353,7 @@ typedef struct TupleHashTableData int numCols; /* number of columns in lookup key */ AttrNumber *keyColIdx; /* attr numbers of key columns */ FmgrInfo *eqfunctions; /* lookup data for comparison functions */ + FmgrInfo *hashfunctions; /* lookup data for hash functions */ MemoryContext tablecxt; /* memory context containing table */ MemoryContext tempcxt; /* context for function evaluations */ Size entrysize; /* actual size to make each hash entry */ @@ -521,6 +522,7 @@ typedef struct SubPlanState ExprContext *innerecontext; /* working context for comparisons */ AttrNumber *keyColIdx; /* control data for hash tables */ FmgrInfo *eqfunctions; /* comparison functions for hash tables */ + FmgrInfo *hashfunctions; /* lookup data for hash functions */ } SubPlanState; /* ---------------- @@ -900,6 +902,7 @@ typedef struct MergeJoinState * unless OuterTupleSlot is nonempty!) * hj_OuterHashKeys the outer hash keys in the hashjoin condition * hj_InnerHashKeys the inner hash keys in the hashjoin condition + * hj_HashOperators the join operators in the hashjoin condition * hj_OuterTupleSlot tuple slot for outer tuples * hj_HashTupleSlot tuple slot for hashed tuples * hj_NullInnerTupleSlot prepared null tuple for left outer joins @@ -917,6 +920,7 @@ typedef struct HashJoinState HashJoinTuple hj_CurTuple; List *hj_OuterHashKeys; /* list of ExprState nodes */ List *hj_InnerHashKeys; /* list of ExprState nodes */ + List *hj_HashOperators; /* list of operator OIDs */ TupleTableSlot *hj_OuterTupleSlot; TupleTableSlot *hj_HashTupleSlot; TupleTableSlot *hj_NullInnerTupleSlot; @@ -992,6 +996,7 @@ typedef struct AggState List *aggs; /* all Aggref nodes in targetlist & quals */ int numaggs; /* length of list (could be zero!) */ FmgrInfo *eqfunctions; /* per-grouping-field equality fns */ + FmgrInfo *hashfunctions; /* per-grouping-field hash fns */ AggStatePerAgg peragg; /* per-Aggref information */ MemoryContext aggcontext; /* memory context for long-lived data */ ExprContext *tmpcontext; /* econtext for input expressions */ |
