diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2006-01-31 21:39:25 +0000 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2006-01-31 21:39:25 +0000 |
| commit | 8a1468af4e5c50dde8ce938886f4672459009b9b (patch) | |
| tree | eb9ae5decb8be1ebca8d124d947d0b7282802953 /src/backend/optimizer/plan/planmain.c | |
| parent | 097df388b72584501762ac4c400dccff8a3671eb (diff) | |
Restructure planner's handling of inheritance. Rather than processing
inheritance trees on-the-fly, which pretty well constrained us to considering
only one way of planning inheritance, expand inheritance sets during the
planner prep phase, and build a side data structure that can be consulted
later to find which RTEs are members of which inheritance sets. As proof of
concept, use the data structure to plan joins against inheritance sets more
efficiently: we can now use indexes on the set members in inner-indexscan
joins. (The generated plans could be improved further, but it'll take some
executor changes.) This data structure will also support handling UNION ALL
subqueries in the same way as inheritance sets, but that aspect of it isn't
finished yet.
Diffstat (limited to 'src/backend/optimizer/plan/planmain.c')
| -rw-r--r-- | src/backend/optimizer/plan/planmain.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/backend/optimizer/plan/planmain.c b/src/backend/optimizer/plan/planmain.c index 3729fd2b199..0783f441b5b 100644 --- a/src/backend/optimizer/plan/planmain.c +++ b/src/backend/optimizer/plan/planmain.c @@ -14,7 +14,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/optimizer/plan/planmain.c,v 1.91 2005/12/20 02:30:36 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/optimizer/plan/planmain.c,v 1.92 2006/01/31 21:39:24 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -120,15 +120,15 @@ query_planner(PlannerInfo *root, List *tlist, double tuple_fraction, &constant_quals); /* - * Init planner lists to empty. We create the base_rel_array with a size - * that will be sufficient if no pullups or inheritance additions happen - * ... otherwise it will be enlarged as needed. + * Init planner lists to empty, and set up the array to hold RelOptInfos + * for "simple" rels. * - * NOTE: in_info_list was set up by subquery_planner, do not touch here + * NOTE: in_info_list and append_rel_list were set up by subquery_planner, + * do not touch here */ - root->base_rel_array_size = list_length(parse->rtable) + 1; - root->base_rel_array = (RelOptInfo **) - palloc0(root->base_rel_array_size * sizeof(RelOptInfo *)); + 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->equi_key_list = NIL; |
