diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2005-09-25 19:37:35 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2005-09-25 19:37:35 +0000 |
commit | e990b9ce23f2be15d48ed518b30931eddd0e59ca (patch) | |
tree | 53b6e38c57dc9ef7d4f3f197bb5f5f278dafe523 /src/include/nodes/execnodes.h | |
parent | dd102d36837fa1461ebd0e9061ded4c5347a42ac (diff) |
The original patch to avoid building a hash join's hashtable when the
outer relation is empty did not work, per test case from Patrick Welche.
It tried to use nodeHashjoin.c's high-level mechanisms for fetching an
outer-relation tuple, but that code expected the hash table to be filled
already. As patched, the code failed in corner cases such as having no
outer-relation tuples for the first hash batch. Revert and rewrite.
Diffstat (limited to 'src/include/nodes/execnodes.h')
-rw-r--r-- | src/include/nodes/execnodes.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/include/nodes/execnodes.h b/src/include/nodes/execnodes.h index 73648f93ade..5e68eae5270 100644 --- a/src/include/nodes/execnodes.h +++ b/src/include/nodes/execnodes.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/nodes/execnodes.h,v 1.137 2005/08/01 20:31:15 tgl Exp $ + * $PostgreSQL: pgsql/src/include/nodes/execnodes.h,v 1.138 2005/09/25 19:37:35 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -1097,6 +1097,7 @@ typedef struct MergeJoinState * hj_OuterTupleSlot tuple slot for outer tuples * hj_HashTupleSlot tuple slot for hashed tuples * hj_NullInnerTupleSlot prepared null tuple for left outer joins + * hj_FirstOuterTupleSlot first tuple retrieved from outer plan * hj_NeedNewOuter true if need new outer tuple on next call * hj_MatchedOuter true if found a join match for current outer * ---------------- @@ -1120,6 +1121,7 @@ typedef struct HashJoinState TupleTableSlot *hj_OuterTupleSlot; TupleTableSlot *hj_HashTupleSlot; TupleTableSlot *hj_NullInnerTupleSlot; + TupleTableSlot *hj_FirstOuterTupleSlot; bool hj_NeedNewOuter; bool hj_MatchedOuter; } HashJoinState; @@ -1232,7 +1234,6 @@ typedef struct HashState HashJoinTable hashtable; /* hash table for the hashjoin */ List *hashkeys; /* list of ExprState nodes */ /* hashkeys is same as parent's hj_InnerHashKeys */ - TupleTableSlot *firstTuple; /* tuple produced by ExecHash() */ } HashState; /* ---------------- |