Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit53e7576

Browse files
committed
Make NestLoop plan nodes pass outer-relation variables into their inner
relation using the general PARAM_EXEC executor parameter mechanism, ratherthan the ad-hoc kluge of passing the outer tuple down through ExecReScan.The previous method was hard to understand and could never be extended tohandle parameters coming from multiple join levels. This patch doesn'tchange the set of possible plans nor have any significant performance effect,but it's necessary infrastructure for future generalization of the conceptof an inner indexscan plan.ExecReScan's second parameter is now unused, so it's removed.
1 parent5a34893 commit53e7576

File tree

76 files changed

+799
-697
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+799
-697
lines changed

‎src/backend/executor/execAmi.c

Lines changed: 31 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
77
* Portions Copyright (c) 1994, Regents of the University of California
88
*
9-
*$PostgreSQL: pgsql/src/backend/executor/execAmi.c,v 1.108 2010/02/14 18:42:14 rhaas Exp $
9+
*$PostgreSQL: pgsql/src/backend/executor/execAmi.c,v 1.109 2010/07/12 17:01:05 tgl Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -59,17 +59,9 @@ static bool IndexSupportsBackwardScan(Oid indexid);
5959
*
6060
* Note that if the plan node has parameters that have changed value,
6161
* the output might be different from last time.
62-
*
63-
* The second parameter is currently only used to pass a NestLoop plan's
64-
* econtext down to its inner child plan, in case that is an indexscan that
65-
* needs access to variables of the current outer tuple. (The handling of
66-
* this parameter is currently pretty inconsistent: some callers pass NULL
67-
* and some pass down their parent's value; so don't rely on it in other
68-
* situations.It'd probably be better to remove the whole thing and use
69-
* the generalized parameter mechanism instead.)
7062
*/
7163
void
72-
ExecReScan(PlanState*node,ExprContext*exprCtxt)
64+
ExecReScan(PlanState*node)
7365
{
7466
/* If collecting timing stats, update them */
7567
if (node->instrument)
@@ -126,119 +118,119 @@ ExecReScan(PlanState *node, ExprContext *exprCtxt)
126118
switch (nodeTag(node))
127119
{
128120
caseT_ResultState:
129-
ExecReScanResult((ResultState*)node,exprCtxt);
121+
ExecReScanResult((ResultState*)node);
130122
break;
131123

132124
caseT_ModifyTableState:
133-
ExecReScanModifyTable((ModifyTableState*)node,exprCtxt);
125+
ExecReScanModifyTable((ModifyTableState*)node);
134126
break;
135127

136128
caseT_AppendState:
137-
ExecReScanAppend((AppendState*)node,exprCtxt);
129+
ExecReScanAppend((AppendState*)node);
138130
break;
139131

140132
caseT_RecursiveUnionState:
141-
ExecRecursiveUnionReScan((RecursiveUnionState*)node,exprCtxt);
133+
ExecReScanRecursiveUnion((RecursiveUnionState*)node);
142134
break;
143135

144136
caseT_BitmapAndState:
145-
ExecReScanBitmapAnd((BitmapAndState*)node,exprCtxt);
137+
ExecReScanBitmapAnd((BitmapAndState*)node);
146138
break;
147139

148140
caseT_BitmapOrState:
149-
ExecReScanBitmapOr((BitmapOrState*)node,exprCtxt);
141+
ExecReScanBitmapOr((BitmapOrState*)node);
150142
break;
151143

152144
caseT_SeqScanState:
153-
ExecSeqReScan((SeqScanState*)node,exprCtxt);
145+
ExecReScanSeqScan((SeqScanState*)node);
154146
break;
155147

156148
caseT_IndexScanState:
157-
ExecIndexReScan((IndexScanState*)node,exprCtxt);
149+
ExecReScanIndexScan((IndexScanState*)node);
158150
break;
159151

160152
caseT_BitmapIndexScanState:
161-
ExecBitmapIndexReScan((BitmapIndexScanState*)node,exprCtxt);
153+
ExecReScanBitmapIndexScan((BitmapIndexScanState*)node);
162154
break;
163155

164156
caseT_BitmapHeapScanState:
165-
ExecBitmapHeapReScan((BitmapHeapScanState*)node,exprCtxt);
157+
ExecReScanBitmapHeapScan((BitmapHeapScanState*)node);
166158
break;
167159

168160
caseT_TidScanState:
169-
ExecTidReScan((TidScanState*)node,exprCtxt);
161+
ExecReScanTidScan((TidScanState*)node);
170162
break;
171163

172164
caseT_SubqueryScanState:
173-
ExecSubqueryReScan((SubqueryScanState*)node,exprCtxt);
165+
ExecReScanSubqueryScan((SubqueryScanState*)node);
174166
break;
175167

176168
caseT_FunctionScanState:
177-
ExecFunctionReScan((FunctionScanState*)node,exprCtxt);
169+
ExecReScanFunctionScan((FunctionScanState*)node);
178170
break;
179171

180172
caseT_ValuesScanState:
181-
ExecValuesReScan((ValuesScanState*)node,exprCtxt);
173+
ExecReScanValuesScan((ValuesScanState*)node);
182174
break;
183175

184176
caseT_CteScanState:
185-
ExecCteScanReScan((CteScanState*)node,exprCtxt);
177+
ExecReScanCteScan((CteScanState*)node);
186178
break;
187179

188180
caseT_WorkTableScanState:
189-
ExecWorkTableScanReScan((WorkTableScanState*)node,exprCtxt);
181+
ExecReScanWorkTableScan((WorkTableScanState*)node);
190182
break;
191183

192184
caseT_NestLoopState:
193-
ExecReScanNestLoop((NestLoopState*)node,exprCtxt);
185+
ExecReScanNestLoop((NestLoopState*)node);
194186
break;
195187

196188
caseT_MergeJoinState:
197-
ExecReScanMergeJoin((MergeJoinState*)node,exprCtxt);
189+
ExecReScanMergeJoin((MergeJoinState*)node);
198190
break;
199191

200192
caseT_HashJoinState:
201-
ExecReScanHashJoin((HashJoinState*)node,exprCtxt);
193+
ExecReScanHashJoin((HashJoinState*)node);
202194
break;
203195

204196
caseT_MaterialState:
205-
ExecMaterialReScan((MaterialState*)node,exprCtxt);
197+
ExecReScanMaterial((MaterialState*)node);
206198
break;
207199

208200
caseT_SortState:
209-
ExecReScanSort((SortState*)node,exprCtxt);
201+
ExecReScanSort((SortState*)node);
210202
break;
211203

212204
caseT_GroupState:
213-
ExecReScanGroup((GroupState*)node,exprCtxt);
205+
ExecReScanGroup((GroupState*)node);
214206
break;
215207

216208
caseT_AggState:
217-
ExecReScanAgg((AggState*)node,exprCtxt);
209+
ExecReScanAgg((AggState*)node);
218210
break;
219211

220212
caseT_WindowAggState:
221-
ExecReScanWindowAgg((WindowAggState*)node,exprCtxt);
213+
ExecReScanWindowAgg((WindowAggState*)node);
222214
break;
223215

224216
caseT_UniqueState:
225-
ExecReScanUnique((UniqueState*)node,exprCtxt);
217+
ExecReScanUnique((UniqueState*)node);
226218
break;
227219

228220
caseT_HashState:
229-
ExecReScanHash((HashState*)node,exprCtxt);
221+
ExecReScanHash((HashState*)node);
230222
break;
231223

232224
caseT_SetOpState:
233-
ExecReScanSetOp((SetOpState*)node,exprCtxt);
225+
ExecReScanSetOp((SetOpState*)node);
234226
break;
235227

236228
caseT_LockRowsState:
237-
ExecReScanLockRows((LockRowsState*)node,exprCtxt);
229+
ExecReScanLockRows((LockRowsState*)node);
238230
break;
239231

240232
caseT_LimitState:
241-
ExecReScanLimit((LimitState*)node,exprCtxt);
233+
ExecReScanLimit((LimitState*)node);
242234
break;
243235

244236
default:

‎src/backend/executor/execMain.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
*
2727
*
2828
* IDENTIFICATION
29-
* $PostgreSQL: pgsql/src/backend/executor/execMain.c,v 1.350 2010/07/09 14:06:01 rhaas Exp $
29+
* $PostgreSQL: pgsql/src/backend/executor/execMain.c,v 1.351 2010/07/12 17:01:05 tgl Exp $
3030
*
3131
*-------------------------------------------------------------------------
3232
*/
@@ -400,7 +400,7 @@ ExecutorRewind(QueryDesc *queryDesc)
400400
/*
401401
* rescan plan
402402
*/
403-
ExecReScan(queryDesc->planstate,NULL);
403+
ExecReScan(queryDesc->planstate);
404404

405405
MemoryContextSwitchTo(oldcontext);
406406
}

‎src/backend/executor/execProcnode.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*
1313
*
1414
* IDENTIFICATION
15-
* $PostgreSQL: pgsql/src/backend/executor/execProcnode.c,v 1.70 2010/01/02 16:57:41 momjian Exp $
15+
* $PostgreSQL: pgsql/src/backend/executor/execProcnode.c,v 1.71 2010/07/12 17:01:05 tgl Exp $
1616
*
1717
*-------------------------------------------------------------------------
1818
*/
@@ -341,7 +341,7 @@ ExecProcNode(PlanState *node)
341341
CHECK_FOR_INTERRUPTS();
342342

343343
if (node->chgParam!=NULL)/* something changed */
344-
ExecReScan(node,NULL);/* let ReScan handle this */
344+
ExecReScan(node);/* let ReScan handle this */
345345

346346
if (node->instrument)
347347
InstrStartNode(node->instrument);
@@ -504,7 +504,7 @@ MultiExecProcNode(PlanState *node)
504504
CHECK_FOR_INTERRUPTS();
505505

506506
if (node->chgParam!=NULL)/* something changed */
507-
ExecReScan(node,NULL);/* let ReScan handle this */
507+
ExecReScan(node);/* let ReScan handle this */
508508

509509
switch (nodeTag(node))
510510
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp