Commit 3fdc374b authored by Etsuro Fujita's avatar Etsuro Fujita

Save PathTargets for distinct/ordered relations in root->upper_targets[].

For the convenience of extensions, we previously only saved PathTargets
for grouped, window, and final relations in root->upper_targets[] in
grouping_planner().  To improve the convenience, save PathTargets for
distinct and ordered relations as well.

Author: Antonin Houska, with an additional change by me
Discussion: https://postgr.es/m/10994.1549559088@localhost
parent a916bdc4
...@@ -2035,6 +2035,8 @@ grouping_planner(PlannerInfo *root, bool inheritance_update, ...@@ -2035,6 +2035,8 @@ grouping_planner(PlannerInfo *root, bool inheritance_update,
* of the corresponding upperrels might not be needed for this query. * of the corresponding upperrels might not be needed for this query.
*/ */
root->upper_targets[UPPERREL_FINAL] = final_target; root->upper_targets[UPPERREL_FINAL] = final_target;
root->upper_targets[UPPERREL_ORDERED] = final_target;
root->upper_targets[UPPERREL_DISTINCT] = sort_input_target;
root->upper_targets[UPPERREL_WINDOW] = sort_input_target; root->upper_targets[UPPERREL_WINDOW] = sort_input_target;
root->upper_targets[UPPERREL_GROUP_AGG] = grouping_target; root->upper_targets[UPPERREL_GROUP_AGG] = grouping_target;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment