1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-13 07:41:39 +03:00

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.
This commit is contained in:
Tom Lane
2006-02-05 02:59:17 +00:00
parent 354213c7f4
commit 336a6491aa
8 changed files with 114 additions and 273 deletions

View File

@ -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;