mirror of
https://github.com/postgres/postgres.git
synced 2025-09-02 04:21:28 +03:00
Cosmetic improvements in setup of planner's per-RTE arrays.
Merge setup_append_rel_array into setup_simple_rel_arrays. There's no particularly good reason to keep them separate, and it's inconsistent with the lack of separation in expand_planner_arrays. The only apparent benefit was that the fast path for trivial queries in query_planner() doesn't need to set up the append_rel_array; but all we're saving there is an if-test and NULL assignment, which surely ought to be negligible. Also improve some obsolete comments. Discussion: https://postgr.es/m/17220.1565301350@sss.pgh.pa.us
This commit is contained in:
@@ -79,9 +79,7 @@ query_planner(PlannerInfo *root,
|
||||
root->initial_rels = NIL;
|
||||
|
||||
/*
|
||||
* Make a flattened version of the rangetable for faster access (this is
|
||||
* OK because the rangetable won't change any more), and set up an empty
|
||||
* array for indexing base relations.
|
||||
* Set up arrays for accessing base relations and AppendRelInfos.
|
||||
*/
|
||||
setup_simple_rel_arrays(root);
|
||||
|
||||
@@ -156,12 +154,6 @@ query_planner(PlannerInfo *root,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Populate append_rel_array with each AppendRelInfo to allow direct
|
||||
* lookups by child relid.
|
||||
*/
|
||||
setup_append_rel_array(root);
|
||||
|
||||
/*
|
||||
* Construct RelOptInfo nodes for all base relations used in the query.
|
||||
* Appendrel member relations ("other rels") will be added later.
|
||||
|
Reference in New Issue
Block a user