Content-Length: 257864 | pFad | http://github.com/postgrespro/postgres/commit/dc02c7bca4dccf7de278cdc6b3325a829e75b252

8C Fix wrong costing of Sort under Gather Merge. · postgrespro/postgres@dc02c7b · GitHub
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

Lines changed: 1 addition & 1 deletion
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)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres/commit/dc02c7bca4dccf7de278cdc6b3325a829e75b252

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy