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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy