Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 8403741

Browse files
committed
Actually, nodeBitmapIndexscan.c doesn't need to create a standard
ExprContext at all, since it never evaluates any qual or tlist expressions.
1 parent 24475a7 commit 8403741

File tree

1 file changed

+11
-20
lines changed

1 file changed

+11
-20
lines changed

src/backend/executor/nodeBitmapIndexscan.c

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/executor/nodeBitmapIndexscan.c,v 1.4 2005/04/23 21:32:34 tgl Exp $
11+
* $PostgreSQL: pgsql/src/backend/executor/nodeBitmapIndexscan.c,v 1.5 2005/04/24 17:32:46 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -132,17 +132,10 @@ ExecBitmapIndexReScan(BitmapIndexScanState *node, ExprContext *exprCtxt)
132132
{
133133
/*
134134
* If we are being passed an outer tuple, save it for runtime key
135-
* calc. We also need to link it into the "regular" per-tuple
136-
* econtext.
135+
* calc.
137136
*/
138137
if (exprCtxt != NULL)
139-
{
140-
ExprContext *stdecontext;
141-
142138
econtext->ecxt_outertuple = exprCtxt->ecxt_outertuple;
143-
stdecontext = node->ss.ps.ps_ExprContext;
144-
stdecontext->ecxt_outertuple = exprCtxt->ecxt_outertuple;
145-
}
146139

147140
/*
148141
* Reset the runtime-key context so we don't leak memory as each
@@ -220,10 +213,9 @@ ExecEndBitmapIndexScan(BitmapIndexScanState *node)
220213
relation = node->ss.ss_currentRelation;
221214

222215
/*
223-
* Free the exprcontext(s) ... now dead code, see ExecFreeExprContext
216+
* Free the exprcontext ... now dead code, see ExecFreeExprContext
224217
*/
225218
#ifdef NOT_USED
226-
ExecFreeExprContext(&node->ss.ps);
227219
if (node->biss_RuntimeContext)
228220
FreeExprContext(node->biss_RuntimeContext);
229221
#endif
@@ -291,9 +283,9 @@ ExecInitBitmapIndexScan(BitmapIndexScan *node, EState *estate)
291283
/*
292284
* Miscellaneous initialization
293285
*
294-
* create expression context for node
286+
* We do not need a standard exprcontext for this node, though we may
287+
* decide below to create a runtime-key exprcontext
295288
*/
296-
ExecAssignExprContext(estate, &indexstate->ss.ps);
297289

298290
/*
299291
* initialize child expressions
@@ -471,14 +463,13 @@ ExecInitBitmapIndexScan(BitmapIndexScan *node, EState *estate)
471463
/*
472464
* If all of our keys have the form (var op const), then we have no
473465
* runtime keys so we store NULL in the runtime key info. Otherwise
474-
* runtime key info contains an array of pointers (one for each index)
475-
* to arrays of flags (one for each key) which indicate that the qual
476-
* needs to be evaluated at runtime. -cim 10/24/89
466+
* runtime key info contains an array of pointers to runtime key
467+
* expressions.
477468
*
478-
* If we do have runtime keys, we need an ExprContext to evaluate them;
479-
* the node's standard context won't do because we want to reset that
480-
* context for every tuple. So, build another context just like the
481-
* other one... -tgl 7/11/00
469+
* If we do have runtime keys, we need an ExprContext to evaluate them.
470+
* We could just create a "standard" plan node exprcontext, but to
471+
* keep the code looking similar to nodeIndexscan.c, it seems better
472+
* to stick with the approach of using a separate ExprContext.
482473
*/
483474
if (have_runtime_keys)
484475
{

0 commit comments

Comments
 (0)