1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-21 00:42:43 +03:00

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.
This commit is contained in:
Tom Lane
2007-04-21 21:01:45 +00:00
parent ac7e6c0665
commit afcf09dd90
11 changed files with 91 additions and 42 deletions

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/optimizer/path/clausesel.c,v 1.84 2007/02/19 07:03:28 tgl Exp $
* $PostgreSQL: pgsql/src/backend/optimizer/path/clausesel.c,v 1.85 2007/04/21 21:01:44 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -500,7 +500,7 @@ clause_selectivity(PlannerInfo *root,
if (var->varlevelsup == 0 &&
(varRelid == 0 || varRelid == (int) var->varno))
{
RangeTblEntry *rte = rt_fetch(var->varno, root->parse->rtable);
RangeTblEntry *rte = planner_rt_fetch(var->varno, root);
if (rte->rtekind == RTE_SUBQUERY)
{