aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/nodeAppend.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2006-02-05 02:59:17 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2006-02-05 02:59:17 +0000
commit336a6491aaa8a2ba9a3118285522f237806b5e37 (patch)
tree8c7313483667dd002728fdc2243d088adf56f5a8 /src/backend/executor/nodeAppend.c
parent354213c7f493596448ca83f13d107a8ef7a08aae (diff)
downloadpostgresql-336a6491aaa8a2ba9a3118285522f237806b5e37.tar.gz
postgresql-336a6491aaa8a2ba9a3118285522f237806b5e37.zip
Improve my initial, rather hacky implementation of joins to append
relations: fix the executor so that we can have an Append plan on the inside of a nestloop and still pass down outer index keys to index scans within the Append, then generate such plans as if they were regular inner indexscans. This avoids the need to evaluate the outer relation multiple times.
Diffstat (limited to 'src/backend/executor/nodeAppend.c')
-rw-r--r--src/backend/executor/nodeAppend.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/backend/executor/nodeAppend.c b/src/backend/executor/nodeAppend.c
index fc5c445db0e..0b5e81096d7 100644
--- a/src/backend/executor/nodeAppend.c
+++ b/src/backend/executor/nodeAppend.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/executor/nodeAppend.c,v 1.65 2005/10/15 02:49:17 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/executor/nodeAppend.c,v 1.66 2006/02/05 02:59:16 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -345,10 +345,12 @@ ExecReScanAppend(AppendState *node, ExprContext *exprCtxt)
UpdateChangedParamSet(subnode, node->ps.chgParam);
/*
- * if chgParam of subnode is not null then plan will be re-scanned by
- * first ExecProcNode.
+ * If chgParam of subnode is not null then plan will be re-scanned by
+ * first ExecProcNode. However, if caller is passing us an exprCtxt
+ * then forcibly rescan all the subnodes now, so that we can pass
+ * the exprCtxt down to the subnodes (needed for appendrel indexscan).
*/
- if (subnode->chgParam == NULL)
+ if (subnode->chgParam == NULL || exprCtxt != NULL)
{
/* make sure estate is correct for this subnode (needed??) */
node->as_whichplan = i;