|
8 | 8 | *
|
9 | 9 | *
|
10 | 10 | * 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 $ |
12 | 12 | *
|
13 | 13 | *-------------------------------------------------------------------------
|
14 | 14 | */
|
@@ -132,17 +132,10 @@ ExecBitmapIndexReScan(BitmapIndexScanState *node, ExprContext *exprCtxt)
|
132 | 132 | {
|
133 | 133 | /*
|
134 | 134 | * 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. |
137 | 136 | */
|
138 | 137 | if (exprCtxt != NULL)
|
139 |
| - { |
140 |
| - ExprContext *stdecontext; |
141 |
| - |
142 | 138 | econtext->ecxt_outertuple = exprCtxt->ecxt_outertuple;
|
143 |
| - stdecontext = node->ss.ps.ps_ExprContext; |
144 |
| - stdecontext->ecxt_outertuple = exprCtxt->ecxt_outertuple; |
145 |
| - } |
146 | 139 |
|
147 | 140 | /*
|
148 | 141 | * Reset the runtime-key context so we don't leak memory as each
|
@@ -220,10 +213,9 @@ ExecEndBitmapIndexScan(BitmapIndexScanState *node)
|
220 | 213 | relation = node->ss.ss_currentRelation;
|
221 | 214 |
|
222 | 215 | /*
|
223 |
| - * Free the exprcontext(s) ... now dead code, see ExecFreeExprContext |
| 216 | + * Free the exprcontext ... now dead code, see ExecFreeExprContext |
224 | 217 | */
|
225 | 218 | #ifdef NOT_USED
|
226 |
| - ExecFreeExprContext(&node->ss.ps); |
227 | 219 | if (node->biss_RuntimeContext)
|
228 | 220 | FreeExprContext(node->biss_RuntimeContext);
|
229 | 221 | #endif
|
@@ -291,9 +283,9 @@ ExecInitBitmapIndexScan(BitmapIndexScan *node, EState *estate)
|
291 | 283 | /*
|
292 | 284 | * Miscellaneous initialization
|
293 | 285 | *
|
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 |
295 | 288 | */
|
296 |
| - ExecAssignExprContext(estate, &indexstate->ss.ps); |
297 | 289 |
|
298 | 290 | /*
|
299 | 291 | * initialize child expressions
|
@@ -471,14 +463,13 @@ ExecInitBitmapIndexScan(BitmapIndexScan *node, EState *estate)
|
471 | 463 | /*
|
472 | 464 | * If all of our keys have the form (var op const), then we have no
|
473 | 465 | * 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. |
477 | 468 | *
|
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. |
482 | 473 | */
|
483 | 474 | if (have_runtime_keys)
|
484 | 475 | {
|
|
0 commit comments