Skip to content

Commit 0832f2d

Browse files
committed
Fix latent costing error in create_merge_append_path.
create_merge_append_path should use the path rowcount it just computed, not rel->tuples, for costing purposes. Those numbers should always be the same at present, but if we ever support parameterized MergeAppend paths (a case this function is otherwise prepared for), the former would be right and the latter wrong. No need for back-patch since the problem is only latent. Ashutosh Bapat Discussion: <CAFjFpRek+cLCnTo24youuGtsq4zRphEB8EUUPjDxZjnL4n4HYQ@mail.gmail.com>
1 parent 13671b4 commit 0832f2d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/backend/optimizer/util/pathnode.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1333,7 +1333,7 @@ create_merge_append_path(PlannerInfo *root,
13331333
cost_merge_append(&pathnode->path, root,
13341334
pathkeys, list_length(subpaths),
13351335
input_startup_cost, input_total_cost,
1336-
rel->tuples);
1336+
pathnode->path.rows);
13371337

13381338
return pathnode;
13391339
}

0 commit comments

Comments
 (0)