MCPcopy Create free account
hub / github.com/apache/cloudberry / ExecReScan

Function ExecReScan

src/backend/executor/execAmi.c:94–403  ·  view source on GitHub ↗

* ExecReScan * Reset a plan node so that its output can be re-scanned. * * Note that if the plan node has parameters that have changed value, * the output might be different from last time. */

Source from the content-addressed store, hash-verified

92 * the output might be different from last time.
93 */
94void
95ExecReScan(PlanState *node)
96{
97 /* If collecting timing stats, update them */
98 if (node->instrument)
99 InstrEndLoop(node->instrument);
100
101 /* no longer squelched */
102 node->squelched = false;
103
104 /*
105 * If we have changed parameters, propagate that info.
106 *
107 * Note: ExecReScanSetParamPlan() can add bits to node->chgParam,
108 * corresponding to the output param(s) that the InitPlan will update.
109 * Since we make only one pass over the list, that means that an InitPlan
110 * can depend on the output param(s) of a sibling InitPlan only if that
111 * sibling appears earlier in the list. This is workable for now given
112 * the limited ways in which one InitPlan could depend on another, but
113 * eventually we might need to work harder (or else make the planner
114 * enlarge the extParam/allParam sets to include the params of depended-on
115 * InitPlans).
116 */
117 if (node->chgParam != NULL)
118 {
119 ListCell *l;
120
121 foreach(l, node->initPlan)
122 {
123 SubPlanState *sstate = (SubPlanState *) lfirst(l);
124 PlanState *splan = sstate->planstate;
125
126 /*
127 * If 'splan' is NULL, then InitPlan() thought it was "alien". We
128 * should not get here then, but let's sanity check.
129 */
130 if (splan == NULL)
131 elog(ERROR, "subplan not initialized in this slice");
132
133 if (splan->plan->extParam != NULL) /* don't care about child
134 * local Params */
135 UpdateChangedParamSet(splan, node->chgParam);
136 if (splan->chgParam != NULL)
137 ExecReScanSetParamPlan(sstate, node);
138 }
139 foreach(l, node->subPlan)
140 {
141 SubPlanState *sstate = (SubPlanState *) lfirst(l);
142 PlanState *splan = sstate->planstate;
143
144 /*
145 * If 'splan' is NULL, then InitPlan() thought it was "alien". We
146 * should not get here then, but let's sanity check.
147 */
148 if (splan == NULL)
149 elog(ERROR, "subplan not initialized in this slice");
150
151 if (splan->plan->extParam != NULL)

Callers 15

ExecutorRewindFunction · 0.85
ExecReScanSetOpFunction · 0.85
ExecIndexOnlyScanFunction · 0.85
ExecReScanUniqueFunction · 0.85
ExecMergeJoin_gutsFunction · 0.85
ExecReScanMergeJoinFunction · 0.85
ExecReScanRuntimeFilterFunction · 0.85
MultiExecBitmapIndexScanFunction · 0.85
initNextTableToScanFunction · 0.85
ExecReScanWindowAggFunction · 0.85
ExecReScanBitmapOrFunction · 0.85
ExecReScanAssertOpFunction · 0.85

Calls 15

InstrEndLoopFunction · 0.85
UpdateChangedParamSetFunction · 0.85
ExecReScanSetParamPlanFunction · 0.85
ReScanExprContextFunction · 0.85
ExecReScanResultFunction · 0.85
ExecReScanProjectSetFunction · 0.85
ExecReScanModifyTableFunction · 0.85
ExecReScanAppendFunction · 0.85
ExecReScanMergeAppendFunction · 0.85
ExecReScanRecursiveUnionFunction · 0.85
ExecReScanAssertOpFunction · 0.85
ExecReScanBitmapAndFunction · 0.85

Tested by

no test coverage detected