aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/nodeFunctionscan.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2005-05-22 22:30:20 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2005-05-22 22:30:20 +0000
commite2159f384268e01282af60515582943bf595ba7b (patch)
tree89fa7f4dce0cb8ed7a3296e08e30e71c01f7f84f /src/backend/executor/nodeFunctionscan.c
parentc61207b0913b947d17b837a3d532de81a385977d (diff)
downloadpostgresql-e2159f384268e01282af60515582943bf595ba7b.tar.gz
postgresql-e2159f384268e01282af60515582943bf595ba7b.zip
Teach the planner to remove SubqueryScan nodes from the plan if they
aren't doing anything useful (ie, neither selection nor projection). Also, extend to SubqueryScan the hacks already in place to avoid unnecessary ExecProject calls when the result would just be the same tuple the subquery already delivered. This saves some overhead in UNION and other set operations, as well as avoiding overhead for unflatten-able subqueries. Per example from Sokolov Yura.
Diffstat (limited to 'src/backend/executor/nodeFunctionscan.c')
-rw-r--r--src/backend/executor/nodeFunctionscan.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/backend/executor/nodeFunctionscan.c b/src/backend/executor/nodeFunctionscan.c
index f8f13f1c786..5cd6de45fda 100644
--- a/src/backend/executor/nodeFunctionscan.c
+++ b/src/backend/executor/nodeFunctionscan.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/executor/nodeFunctionscan.c,v 1.33 2005/04/14 22:09:40 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/executor/nodeFunctionscan.c,v 1.34 2005/05/22 22:30:19 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -219,8 +219,7 @@ ExecInitFunctionScan(FunctionScan *node, EState *estate)
BlessTupleDesc(tupdesc);
scanstate->tupdesc = tupdesc;
- ExecSetSlotDescriptor(scanstate->ss.ss_ScanTupleSlot,
- tupdesc, false);
+ ExecAssignScanType(&scanstate->ss, tupdesc, false);
/*
* Other node-specific setup
@@ -235,7 +234,7 @@ ExecInitFunctionScan(FunctionScan *node, EState *estate)
* Initialize result tuple type and projection info.
*/
ExecAssignResultTypeFromTL(&scanstate->ss.ps);
- ExecAssignProjectionInfo(&scanstate->ss.ps);
+ ExecAssignScanProjectionInfo(&scanstate->ss);
return scanstate;
}