aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/nodeFunctionscan.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2007-02-19 02:23:12 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2007-02-19 02:23:12 +0000
commitb8c326779246d6554a0868270639714cc4989a0e (patch)
tree886a2bb16966a9c3ef9e29a2a8767a98f46fa0dd /src/backend/executor/nodeFunctionscan.c
parentf1f2b2711a4c91064a5e64def9816c11f1bd4276 (diff)
downloadpostgresql-b8c326779246d6554a0868270639714cc4989a0e.tar.gz
postgresql-b8c326779246d6554a0868270639714cc4989a0e.zip
Put function expressions and values lists into FunctionScan and ValuesScan
plan nodes, so that the executor does not need to get these items from the range table at runtime. This will avoid needing to include these fields in the compact range table I'm expecting to make the executor use.
Diffstat (limited to 'src/backend/executor/nodeFunctionscan.c')
-rw-r--r--src/backend/executor/nodeFunctionscan.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/src/backend/executor/nodeFunctionscan.c b/src/backend/executor/nodeFunctionscan.c
index f7ca022f1c7..d3d9886e3c3 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.42 2007/01/05 22:19:28 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/executor/nodeFunctionscan.c,v 1.43 2007/02/19 02:23:11 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -118,7 +118,6 @@ FunctionScanState *
ExecInitFunctionScan(FunctionScan *node, EState *estate, int eflags)
{
FunctionScanState *scanstate;
- RangeTblEntry *rte;
Oid funcrettype;
TypeFuncClass functypclass;
TupleDesc tupdesc = NULL;
@@ -162,16 +161,10 @@ ExecInitFunctionScan(FunctionScan *node, EState *estate, int eflags)
(PlanState *) scanstate);
/*
- * get info about function
- */
- rte = rt_fetch(node->scan.scanrelid, estate->es_range_table);
- Assert(rte->rtekind == RTE_FUNCTION);
-
- /*
* Now determine if the function returns a simple or composite type, and
* build an appropriate tupdesc.
*/
- functypclass = get_expr_result_type(rte->funcexpr,
+ functypclass = get_expr_result_type(node->funcexpr,
&funcrettype,
&tupdesc);
@@ -185,7 +178,7 @@ ExecInitFunctionScan(FunctionScan *node, EState *estate, int eflags)
else if (functypclass == TYPEFUNC_SCALAR)
{
/* Base data type, i.e. scalar */
- char *attname = strVal(linitial(rte->eref->colnames));
+ char *attname = strVal(linitial(node->funccolnames));
tupdesc = CreateTemplateTupleDesc(1, false);
TupleDescInitEntry(tupdesc,
@@ -197,9 +190,9 @@ ExecInitFunctionScan(FunctionScan *node, EState *estate, int eflags)
}
else if (functypclass == TYPEFUNC_RECORD)
{
- tupdesc = BuildDescFromLists(rte->eref->colnames,
- rte->funccoltypes,
- rte->funccoltypmods);
+ tupdesc = BuildDescFromLists(node->funccolnames,
+ node->funccoltypes,
+ node->funccoltypmods);
}
else
{
@@ -221,7 +214,7 @@ ExecInitFunctionScan(FunctionScan *node, EState *estate, int eflags)
* Other node-specific setup
*/
scanstate->tuplestorestate = NULL;
- scanstate->funcexpr = ExecInitExpr((Expr *) rte->funcexpr,
+ scanstate->funcexpr = ExecInitExpr((Expr *) node->funcexpr,
(PlanState *) scanstate);
scanstate->ss.ps.ps_TupFromTlist = false;