8
8
*
9
9
*
10
10
* IDENTIFICATION
11
- * $PostgreSQL: pgsql/src/backend/executor/nodeHash.c,v 1.94 2005/06/15 07:27:44 neilc Exp $
11
+ * $PostgreSQL: pgsql/src/backend/executor/nodeHash.c,v 1.95 2005/09/25 19:37:34 tgl Exp $
12
12
*
13
13
*-------------------------------------------------------------------------
14
14
*/
@@ -37,22 +37,14 @@ static void ExecHashIncreaseNumBatches(HashJoinTable hashtable);
37
37
/* ----------------------------------------------------------------
38
38
* ExecHash
39
39
*
40
- * produce the first tuple from our child node (and _only_ the
41
- * first tuple). This is of limited general use -- it does not
42
- * hash its output, and produces only a single tuple. It is
43
- * provided so that hash join can probe the inner hash input to
44
- * determine whether it is empty without needing to build the
45
- * entire hash table first, which is what MultiExecHash() would
46
- * do.
40
+ * stub for pro forma compliance
47
41
* ----------------------------------------------------------------
48
42
*/
49
43
TupleTableSlot *
50
44
ExecHash (HashState * node )
51
45
{
52
- if (TupIsNull (node -> firstTuple ))
53
- node -> firstTuple = ExecProcNode (outerPlanState (node ));
54
-
55
- return node -> firstTuple ;
46
+ elog (ERROR , "Hash node does not support ExecProcNode call convention" );
47
+ return NULL ;
56
48
}
57
49
58
50
/* ----------------------------------------------------------------
@@ -71,7 +63,6 @@ MultiExecHash(HashState *node)
71
63
TupleTableSlot * slot ;
72
64
ExprContext * econtext ;
73
65
uint32 hashvalue ;
74
- bool cleared_first_tuple = false;
75
66
76
67
/* must provide our own instrumentation support */
77
68
if (node -> ps .instrument )
@@ -94,19 +85,9 @@ MultiExecHash(HashState *node)
94
85
*/
95
86
for (;;)
96
87
{
97
- /* use and clear the tuple produced by ExecHash(), if any */
98
- if (!TupIsNull (node -> firstTuple ))
99
- {
100
- slot = node -> firstTuple ;
101
- node -> firstTuple = NULL ;
102
- cleared_first_tuple = true;
103
- }
104
- else
105
- {
106
- slot = ExecProcNode (outerNode );
107
- if (TupIsNull (slot ))
108
- break ;
109
- }
88
+ slot = ExecProcNode (outerNode );
89
+ if (TupIsNull (slot ))
90
+ break ;
110
91
hashtable -> totalTuples += 1 ;
111
92
/* We have to compute the hash value */
112
93
econtext -> ecxt_innertuple = slot ;
@@ -116,19 +97,7 @@ MultiExecHash(HashState *node)
116
97
117
98
/* must provide our own instrumentation support */
118
99
if (node -> ps .instrument )
119
- {
120
- /*
121
- * XXX: kludge -- if ExecHash() was invoked, we've already
122
- * included the tuple that it produced in the row output count
123
- * for this node, so subtract 1 from the # of hashed tuples.
124
- */
125
- if (cleared_first_tuple )
126
- InstrStopNodeMulti (node -> ps .instrument ,
127
- hashtable -> totalTuples - 1 );
128
- else
129
- InstrStopNodeMulti (node -> ps .instrument ,
130
- hashtable -> totalTuples );
131
- }
100
+ InstrStopNodeMulti (node -> ps .instrument , hashtable -> totalTuples );
132
101
133
102
/*
134
103
* We do not return the hash table directly because it's not a subtype
@@ -161,7 +130,6 @@ ExecInitHash(Hash *node, EState *estate)
161
130
hashstate -> ps .state = estate ;
162
131
hashstate -> hashtable = NULL ;
163
132
hashstate -> hashkeys = NIL ; /* will be set by parent HashJoin */
164
- hashstate -> firstTuple = NULL ;
165
133
166
134
/*
167
135
* Miscellaneous initialization
@@ -221,8 +189,6 @@ ExecEndHash(HashState *node)
221
189
{
222
190
PlanState * outerPlan ;
223
191
224
- node -> firstTuple = NULL ;
225
-
226
192
/*
227
193
* free exprcontext
228
194
*/
@@ -864,8 +830,6 @@ ExecHashTableReset(HashJoinTable hashtable)
864
830
void
865
831
ExecReScanHash (HashState * node , ExprContext * exprCtxt )
866
832
{
867
- node -> firstTuple = NULL ;
868
-
869
833
/*
870
834
* if chgParam of subnode is not null then plan will be re-scanned by
871
835
* first ExecProcNode.
0 commit comments