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

Commit dc02c7b

Browse files
committed
Fix wrong costing of Sort under Gather Merge.
There's no mechanism for such a sort to become a top-N sort, so we should pass -1 rather than limit_tuples to cost_sort(). Rushabh Lathia, per a report from Mithun Cy Discussion: http://postgr.es/m/CAGPqQf1akRcSgC9=6iwx=sEPap9UvPpHJLzg8_N+OuHdb6fL+g@mail.gmail.com
1 parent 6b76f1b commit dc02c7b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/backend/optimizer/plan/planner.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -4416,7 +4416,7 @@ create_ordered_paths(PlannerInfo *root,
44164416
ordered_rel,
44174417
cheapest_partial_path,
44184418
root->sort_pathkeys,
4419-
limit_tuples);
4419+
-1.0);
44204420

44214421
total_groups = cheapest_partial_path->rows *
44224422
cheapest_partial_path->parallel_workers;

0 commit comments

Comments
 (0)