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/outfuncs.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/outfuncs.c')
-rw-r--r-- | src/backend/nodes/outfuncs.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/backend/nodes/outfuncs.c b/src/backend/nodes/outfuncs.c index dba8d4b6690..ff4a9aaeefd 100644 --- a/src/backend/nodes/outfuncs.c +++ b/src/backend/nodes/outfuncs.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/nodes/outfuncs.c,v 1.385 2010/03/30 21:58:10 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/nodes/outfuncs.c,v 1.386 2010/07/12 17:01:05 tgl Exp $ * * NOTES * Every node type that can appear in stored rules' parsetrees *must* @@ -517,6 +517,8 @@ _outNestLoop(StringInfo str, NestLoop *node) WRITE_NODE_TYPE("NESTLOOP"); _outJoinPlanInfo(str, (Join *) node); + + WRITE_NODE_FIELD(nestParams); } static void @@ -749,6 +751,15 @@ _outLimit(StringInfo str, Limit *node) } static void +_outNestLoopParam(StringInfo str, NestLoopParam *node) +{ + WRITE_NODE_TYPE("NESTLOOPPARAM"); + + WRITE_INT_FIELD(paramno); + WRITE_NODE_FIELD(paramval); +} + +static void _outPlanRowMark(StringInfo str, PlanRowMark *node) { WRITE_NODE_TYPE("PLANROWMARK"); @@ -1565,6 +1576,8 @@ _outPlannerInfo(StringInfo str, PlannerInfo *node) WRITE_BOOL_FIELD(hasPseudoConstantQuals); WRITE_BOOL_FIELD(hasRecursion); WRITE_INT_FIELD(wt_param_id); + WRITE_BITMAPSET_FIELD(curOuterRels); + WRITE_NODE_FIELD(curOuterParams); } static void @@ -2562,6 +2575,9 @@ _outNode(StringInfo str, void *obj) case T_Limit: _outLimit(str, obj); break; + case T_NestLoopParam: + _outNestLoopParam(str, obj); + break; case T_PlanRowMark: _outPlanRowMark(str, obj); break; |