diff options
| author | Tom Lane | 2010-11-08 20:15:02 +0000 |
|---|---|---|
| committer | Tom Lane | 2010-11-08 20:15:02 +0000 |
| commit | 947d0c862c895618a874344322e7b07c9df05cb2 (patch) | |
| tree | d93d5d236afc198144305ee6bedee2b78b6bfff0 /src/include/optimizer | |
| parent | 543d22fc7423747afd59fe7214f2ddf6259efc62 (diff) | |
Use appendrel planning logic for top-level UNION ALL structures.
Formerly, we could convert a UNION ALL structure inside a subquery-in-FROM
into an appendrel, as a side effect of pulling up the subquery into its
parent; but top-level UNION ALL always caused use of plan_set_operations().
That didn't matter too much because you got an Append-based plan either
way. However, now that the appendrel code can do things with MergeAppend,
it's worthwhile to hack up the top-level case so it also uses appendrels.
This is a bit of a stopgap; but going much further than this will require
a major rewrite of the planner's set-operations support, which I'm not
prepared to undertake now. For the moment let's grab the low-hanging fruit.
Diffstat (limited to 'src/include/optimizer')
| -rw-r--r-- | src/include/optimizer/prep.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/include/optimizer/prep.h b/src/include/optimizer/prep.h index f8dd5428ee4..9f8e379c24b 100644 --- a/src/include/optimizer/prep.h +++ b/src/include/optimizer/prep.h @@ -26,6 +26,7 @@ extern void inline_set_returning_functions(PlannerInfo *root); extern Node *pull_up_subqueries(PlannerInfo *root, Node *jtnode, JoinExpr *lowest_outer_join, AppendRelInfo *containing_appendrel); +extern void flatten_simple_union_all(PlannerInfo *root); extern void reduce_outer_joins(PlannerInfo *root); extern Relids get_relids_in_jointree(Node *jtnode, bool include_joins); extern Relids get_relids_for_join(PlannerInfo *root, int joinrelid); |
