From afcf09dd9034f24e34dd46f69938882ab5b103d2 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sat, 21 Apr 2007 21:01:45 +0000 Subject: 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. --- src/backend/optimizer/plan/createplan.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/backend/optimizer/plan/createplan.c') diff --git a/src/backend/optimizer/plan/createplan.c b/src/backend/optimizer/plan/createplan.c index 9b9645faf28..74b89125665 100644 --- a/src/backend/optimizer/plan/createplan.c +++ b/src/backend/optimizer/plan/createplan.c @@ -10,7 +10,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/optimizer/plan/createplan.c,v 1.228 2007/04/06 22:33:42 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/optimizer/plan/createplan.c,v 1.229 2007/04/21 21:01:44 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -1353,7 +1353,7 @@ create_functionscan_plan(PlannerInfo *root, Path *best_path, /* it should be a function base rel... */ Assert(scan_relid > 0); - rte = rt_fetch(scan_relid, root->parse->rtable); + rte = planner_rt_fetch(scan_relid, root); Assert(rte->rtekind == RTE_FUNCTION); /* Sort clauses into best execution order */ @@ -1388,7 +1388,7 @@ create_valuesscan_plan(PlannerInfo *root, Path *best_path, /* it should be a values base rel... */ Assert(scan_relid > 0); - rte = rt_fetch(scan_relid, root->parse->rtable); + rte = planner_rt_fetch(scan_relid, root); Assert(rte->rtekind == RTE_VALUES); /* Sort clauses into best execution order */ -- cgit v1.2.3