diff options
Diffstat (limited to 'src/backend/optimizer/plan/planmain.c')
-rw-r--r-- | src/backend/optimizer/plan/planmain.c | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/src/backend/optimizer/plan/planmain.c b/src/backend/optimizer/plan/planmain.c index ff39d5754dc..55311058e59 100644 --- a/src/backend/optimizer/plan/planmain.c +++ b/src/backend/optimizer/plan/planmain.c @@ -98,7 +98,6 @@ query_planner(PlannerInfo *root, List *tlist, Path *cheapestpath; Path *sortedpath; Index rti; - ListCell *lc; double total_pages; /* Make tuple_fraction, limit_tuples accessible to lower-level routines */ @@ -128,15 +127,11 @@ query_planner(PlannerInfo *root, List *tlist, } /* - * Init planner lists to empty, and set up the array to hold RelOptInfos - * for "simple" rels. + * Init planner lists to empty. * * NOTE: append_rel_list was set up by subquery_planner, so do not touch * here; eq_classes and minmax_aggs may contain data already, too. */ - root->simple_rel_array_size = list_length(parse->rtable) + 1; - root->simple_rel_array = (RelOptInfo **) - palloc0(root->simple_rel_array_size * sizeof(RelOptInfo *)); root->join_rel_list = NIL; root->join_rel_hash = NULL; root->join_rel_level = NULL; @@ -151,17 +146,10 @@ query_planner(PlannerInfo *root, List *tlist, /* * Make a flattened version of the rangetable for faster access (this is - * OK because the rangetable won't change any more). + * OK because the rangetable won't change any more), and set up an + * empty array for indexing base relations. */ - root->simple_rte_array = (RangeTblEntry **) - palloc0(root->simple_rel_array_size * sizeof(RangeTblEntry *)); - rti = 1; - foreach(lc, parse->rtable) - { - RangeTblEntry *rte = (RangeTblEntry *) lfirst(lc); - - root->simple_rte_array[rti++] = rte; - } + setup_simple_rel_arrays(root); /* * Construct RelOptInfo nodes for all base relations in query, and |