index 8e55dcc159b0b2cb61ac53d71827f888e3d942a0..53fb56f7388e83c53343a3431e387dc9f6b6653a 100644 (file)
*/
ExecClearTuple(slot);
- /* Also must reset the hashtempcxt after each hashtable lookup. */
- MemoryContextReset(node->hashtempcxt);
+ /* Also must reset the innerecontext after each hashtable lookup. */
+ ResetExprContext(node->innerecontext);
return BoolGetDatum(result);
}
@@ -529,7 +529,7 @@ buildSubPlanHash(SubPlanState *node, ExprContext *econtext)
0,
node->planstate->state->es_query_cxt,
node->hashtablecxt,
- node->hashtempcxt,
+ innerecontext->ecxt_per_tuple_memory,
false);
if (!subplan->unknownEqFalse)
@@ -558,7 +558,7 @@ buildSubPlanHash(SubPlanState *node, ExprContext *econtext)
0,
node->planstate->state->es_query_cxt,
node->hashtablecxt,
- node->hashtempcxt,
+ innerecontext->ecxt_per_tuple_memory,
false);
}
else
@@ -620,12 +620,9 @@ buildSubPlanHash(SubPlanState *node, ExprContext *econtext)
/*
* Reset innerecontext after each inner tuple to free any memory used
- * during ExecProject.
+ * during ExecProject and hashtable lookup.
*/
ResetExprContext(innerecontext);
-
- /* Also must reset the hashtempcxt after each hashtable lookup. */
- MemoryContextReset(node->hashtempcxt);
}
/*
@@ -842,7 +839,6 @@ ExecInitSubPlan(SubPlan *subplan, PlanState *parent)
sstate->hashtable = NULL;
sstate->hashnulls = NULL;
sstate->hashtablecxt = NULL;
- sstate->hashtempcxt = NULL;
sstate->innerecontext = NULL;
sstate->keyColIdx = NULL;
sstate->tab_eq_funcoids = NULL;
@@ -898,11 +894,6 @@ ExecInitSubPlan(SubPlan *subplan, PlanState *parent)
AllocSetContextCreate(CurrentMemoryContext,
"Subplan HashTable Context",
ALLOCSET_DEFAULT_SIZES);
- /* and a small one for the hash tables to use as temp storage */
- sstate->hashtempcxt =
- AllocSetContextCreate(CurrentMemoryContext,
- "Subplan HashTable Temp Context",
- ALLOCSET_SMALL_SIZES);
/* and a short-lived exprcontext for function evaluation */
sstate->innerecontext = CreateExprContext(estate);
index de782014b2d41a527113a951d8dd3be2b3d51da1..71857feae4823107ebebe17b1b7764e3c501161a 100644 (file)
bool havehashrows; /* true if hashtable is not empty */
bool havenullrows; /* true if hashnulls is not empty */
MemoryContext hashtablecxt; /* memory context containing hash tables */
- MemoryContext hashtempcxt; /* temp memory context for hash tables */
ExprContext *innerecontext; /* econtext for computing inner tuples */
int numCols; /* number of columns being hashed */
/* each of the remaining fields is an array of length numCols: */