From 5b9d655ba7823cf52fcae1038ec48c347c39029f Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sat, 30 Oct 1999 23:13:30 +0000 Subject: Avoid duplicate ExecTypeFromTL() call in ExecInitJunkFilter() by passing in the TupleDesc that the caller already has (for call from ExecMain) or can make just as easily as ExecInitJunkFilter() can (for call from ExecAppend). Also, don't bother to build a junk filter for an INSERT operation that doesn't actually need one, which is the normal case. --- src/backend/executor/nodeAppend.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) (limited to 'src/backend/executor/nodeAppend.c') diff --git a/src/backend/executor/nodeAppend.c b/src/backend/executor/nodeAppend.c index f20d9c56bc6..e04113149fa 100644 --- a/src/backend/executor/nodeAppend.c +++ b/src/backend/executor/nodeAppend.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/executor/nodeAppend.c,v 1.26 1999/09/24 00:24:23 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/executor/nodeAppend.c,v 1.27 1999/10/30 23:13:30 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -276,9 +276,6 @@ ExecInitAppend(Append *node, EState *estate, Plan *parent) for (i = 0; i < nplans; i++) { - JunkFilter *j; - List *targetList; - /* ---------------- * NOTE: we first modify range table in * exec_append_initialize_next() and @@ -302,9 +299,8 @@ ExecInitAppend(Append *node, EState *estate, Plan *parent) if ((es_rri != (RelationInfo *) NULL) && (node->inheritrelid == es_rri->ri_RangeTableIndex)) { - - targetList = initNode->targetlist; - j = (JunkFilter *) ExecInitJunkFilter(targetList); + JunkFilter *j = ExecInitJunkFilter(initNode->targetlist, + ExecGetTupType(initNode)); junkList = lappend(junkList, j); } @@ -318,9 +314,7 @@ ExecInitAppend(Append *node, EState *estate, Plan *parent) * ---------------- */ initNode = (Plan *) nth(0, appendplans); - ExecAssignResultType(&appendstate->cstate, -/* ExecGetExecTupDesc(initNode), */ - ExecGetTupType(initNode)); + ExecAssignResultType(&appendstate->cstate, ExecGetTupType(initNode)); appendstate->cstate.cs_ProjInfo = NULL; /* ---------------- @@ -329,9 +323,7 @@ ExecInitAppend(Append *node, EState *estate, Plan *parent) */ appendstate->as_whichplan = 0; exec_append_initialize_next(node); -#ifdef NOT_USED - result = (List *) initialized[0]; -#endif + return TRUE; } -- cgit v1.2.3