diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2010-07-12 17:01:06 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2010-07-12 17:01:06 +0000 |
commit | 53e757689ce94520f1c53a89dbaa14ea57b09da7 (patch) | |
tree | afa68ba05699223a719104b953bc20f37d4c33d1 /src/backend/nodes/copyfuncs.c | |
parent | 5a3489357fb61f1ea76412ada33549aca152ad55 (diff) | |
download | postgresql-53e757689ce94520f1c53a89dbaa14ea57b09da7.tar.gz postgresql-53e757689ce94520f1c53a89dbaa14ea57b09da7.zip |
Make NestLoop plan nodes pass outer-relation variables into their inner
relation using the general PARAM_EXEC executor parameter mechanism, rather
than the ad-hoc kluge of passing the outer tuple down through ExecReScan.
The previous method was hard to understand and could never be extended to
handle parameters coming from multiple join levels. This patch doesn't
change the set of possible plans nor have any significant performance effect,
but it's necessary infrastructure for future generalization of the concept
of an inner indexscan plan.
ExecReScan's second parameter is now unused, so it's removed.
Diffstat (limited to 'src/backend/nodes/copyfuncs.c')
-rw-r--r-- | src/backend/nodes/copyfuncs.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/src/backend/nodes/copyfuncs.c b/src/backend/nodes/copyfuncs.c index 829dc7ba8d2..8e47403a485 100644 --- a/src/backend/nodes/copyfuncs.c +++ b/src/backend/nodes/copyfuncs.c @@ -15,7 +15,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/nodes/copyfuncs.c,v 1.464 2010/02/26 02:00:43 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/nodes/copyfuncs.c,v 1.465 2010/07/12 17:01:05 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -564,6 +564,11 @@ _copyNestLoop(NestLoop *from) */ CopyJoinFields((Join *) from, (Join *) newnode); + /* + * copy remainder of node + */ + COPY_NODE_FIELD(nestParams); + return newnode; } @@ -845,6 +850,20 @@ _copyLimit(Limit *from) } /* + * _copyNestLoopParam + */ +static NestLoopParam * +_copyNestLoopParam(NestLoopParam *from) +{ + NestLoopParam *newnode = makeNode(NestLoopParam); + + COPY_SCALAR_FIELD(paramno); + COPY_NODE_FIELD(paramval); + + return newnode; +} + +/* * _copyPlanRowMark */ static PlanRowMark * @@ -3671,6 +3690,9 @@ copyObject(void *from) case T_Limit: retval = _copyLimit(from); break; + case T_NestLoopParam: + retval = _copyNestLoopParam(from); + break; case T_PlanRowMark: retval = _copyPlanRowMark(from); break; |