diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2007-04-21 21:01:45 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2007-04-21 21:01:45 +0000 |
commit | afcf09dd9034f24e34dd46f69938882ab5b103d2 (patch) | |
tree | 497edd9a542b2bc9312afe2f39341f7b95a892c5 /src/backend/optimizer/util/plancat.c | |
parent | ac7e6c0665a377fb0e4e5b12cfc762c1b14e425e (diff) | |
download | postgresql-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/util/plancat.c')
-rw-r--r-- | src/backend/optimizer/util/plancat.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/backend/optimizer/util/plancat.c b/src/backend/optimizer/util/plancat.c index 33b081ffffd..662fcbaaf8e 100644 --- a/src/backend/optimizer/util/plancat.c +++ b/src/backend/optimizer/util/plancat.c @@ -9,7 +9,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/optimizer/util/plancat.c,v 1.133 2007/04/06 22:33:42 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/optimizer/util/plancat.c,v 1.134 2007/04/21 21:01:45 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -497,6 +497,9 @@ get_relation_constraints(Oid relationObjectId, RelOptInfo *rel) * Detect whether the relation need not be scanned because it has either * self-inconsistent restrictions, or restrictions inconsistent with the * relation's CHECK constraints. + * + * Note: this examines only rel->relid and rel->baserestrictinfo; therefore + * it can be called before filling in other fields of the RelOptInfo. */ bool relation_excluded_by_constraints(RelOptInfo *rel, RangeTblEntry *rte) @@ -595,7 +598,7 @@ build_physical_tlist(PlannerInfo *root, RelOptInfo *rel) { List *tlist = NIL; Index varno = rel->relid; - RangeTblEntry *rte = rt_fetch(varno, root->parse->rtable); + RangeTblEntry *rte = planner_rt_fetch(varno, root); Relation relation; Query *subquery; Var *var; |