diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 1999-10-30 23:13:30 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 1999-10-30 23:13:30 +0000 |
commit | 5b9d655ba7823cf52fcae1038ec48c347c39029f (patch) | |
tree | ce91eb497ec248920df1ca194cb9d68afc398aeb /src/backend/executor/execJunk.c | |
parent | 4ce4d7f7d321979c38c2d9177eac634f92da6070 (diff) |
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.
Diffstat (limited to 'src/backend/executor/execJunk.c')
-rw-r--r-- | src/backend/executor/execJunk.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/src/backend/executor/execJunk.c b/src/backend/executor/execJunk.c index 04847867942..2d3fdd92280 100644 --- a/src/backend/executor/execJunk.c +++ b/src/backend/executor/execJunk.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/executor/execJunk.c,v 1.20 1999/07/17 20:16:56 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/executor/execJunk.c,v 1.21 1999/10/30 23:13:30 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -55,17 +55,18 @@ * ExecInitJunkFilter * * Initialize the Junk filter. + * + * The initial targetlist and associated tuple descriptor are passed in. *------------------------------------------------------------------------- */ JunkFilter * -ExecInitJunkFilter(List *targetList) +ExecInitJunkFilter(List *targetList, TupleDesc tupType) { JunkFilter *junkfilter; List *cleanTargetList; int len, cleanLength; - TupleDesc tupType, - cleanTupType; + TupleDesc cleanTupType; List *t; TargetEntry *tle; Resdom *resdom, @@ -154,15 +155,11 @@ ExecInitJunkFilter(List *targetList) } /* --------------------- - * Now calculate the tuple types for the original and the clean tuple - * - * XXX ExecTypeFromTL should be used sparingly. Don't we already - * have the tupType corresponding to the targetlist we are passed? - * -cim 5/31/91 + * Now calculate the tuple type for the cleaned tuple (we were already + * given the type for the original targetlist). * --------------------- */ - tupType = (TupleDesc) ExecTypeFromTL(targetList); - cleanTupType = (TupleDesc) ExecTypeFromTL(cleanTargetList); + cleanTupType = ExecTypeFromTL(cleanTargetList); len = ExecTargetListLength(targetList); cleanLength = ExecTargetListLength(cleanTargetList); |