Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 38fc547

Browse files
committed
Re-fix wrong costing of Sort under Gather Merge.
Commit dc02c7b changed this call to create_sort_path() to take -1 rather than limit_tuples because, at that time, there was no way for a Sort beneath a Gather Merge to become a top-N sort. Later, commit 3452dc5 provided a way for a Sort beneath a Gather Merge to become a top-N sort, but failed to revert the previous commit in the process. Do that. Report and analysis by Jeff Janes; patch by Thomas Munro; review by Amit Kapila and by me. Discussion: http://postgr.es/m/CAEepm=1BWtC34vUroA0Uqjw02MaqdUrW+d6WD85_k8SLyPiKHQ@mail.gmail.com
1 parent 09a65f5 commit 38fc547

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/backend/optimizer/plan/planner.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5059,7 +5059,7 @@ create_ordered_paths(PlannerInfo *root,
50595059
ordered_rel,
50605060
cheapest_partial_path,
50615061
root->sort_pathkeys,
5062-
-1.0);
5062+
limit_tuples);
50635063

50645064
total_groups = cheapest_partial_path->rows *
50655065
cheapest_partial_path->parallel_workers;

0 commit comments

Comments
 (0)