aboutsummaryrefslogtreecommitdiff
path: root/src/backend/optimizer/path/costsize.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2007-04-21 21:01:45 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2007-04-21 21:01:45 +0000
commitafcf09dd9034f24e34dd46f69938882ab5b103d2 (patch)
tree497edd9a542b2bc9312afe2f39341f7b95a892c5 /src/backend/optimizer/path/costsize.c
parentac7e6c0665a377fb0e4e5b12cfc762c1b14e425e (diff)
downloadpostgresql-afcf09dd9034f24e34dd46f69938882ab5b103d2.tar.gz
postgresql-afcf09dd9034f24e34dd46f69938882ab5b103d2.zip
Some further performance tweaks for planning large inheritance trees that
are mostly excluded by constraints: do the CE test a bit earlier to save some adjust_appendrel_attrs() work on excluded children, and arrange to use array indexing rather than rt_fetch() to fetch RTEs in the main body of the planner. The latter is something I'd wanted to do for awhile anyway, but seeing list_nth_cell() as 35% of the runtime gets one's attention.
Diffstat (limited to 'src/backend/optimizer/path/costsize.c')
-rw-r--r--src/backend/optimizer/path/costsize.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/backend/optimizer/path/costsize.c b/src/backend/optimizer/path/costsize.c
index 42a5520b974..9cd3a51d897 100644
--- a/src/backend/optimizer/path/costsize.c
+++ b/src/backend/optimizer/path/costsize.c
@@ -54,7 +54,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/optimizer/path/costsize.c,v 1.180 2007/04/21 02:41:13 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/optimizer/path/costsize.c,v 1.181 2007/04/21 21:01:44 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -856,7 +856,7 @@ cost_functionscan(Path *path, PlannerInfo *root, RelOptInfo *baserel)
/* Should only be applied to base relations that are functions */
Assert(baserel->relid > 0);
- rte = rt_fetch(baserel->relid, root->parse->rtable);
+ rte = planner_rt_fetch(baserel->relid, root);
Assert(rte->rtekind == RTE_FUNCTION);
/* Estimate costs of executing the function expression */
@@ -2297,7 +2297,7 @@ set_function_size_estimates(PlannerInfo *root, RelOptInfo *rel)
/* Should only be applied to base relations that are functions */
Assert(rel->relid > 0);
- rte = rt_fetch(rel->relid, root->parse->rtable);
+ rte = planner_rt_fetch(rel->relid, root);
Assert(rte->rtekind == RTE_FUNCTION);
/* Estimate number of rows the function itself will return */
@@ -2323,7 +2323,7 @@ set_values_size_estimates(PlannerInfo *root, RelOptInfo *rel)
/* Should only be applied to base relations that are values lists */
Assert(rel->relid > 0);
- rte = rt_fetch(rel->relid, root->parse->rtable);
+ rte = planner_rt_fetch(rel->relid, root);
Assert(rte->rtekind == RTE_VALUES);
/*