Commit 0832f2db authored by Tom Lane's avatar Tom Lane

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>
parent 13671b4b
...@@ -1333,7 +1333,7 @@ create_merge_append_path(PlannerInfo *root, ...@@ -1333,7 +1333,7 @@ create_merge_append_path(PlannerInfo *root,
cost_merge_append(&pathnode->path, root, cost_merge_append(&pathnode->path, root,
pathkeys, list_length(subpaths), pathkeys, list_length(subpaths),
input_startup_cost, input_total_cost, input_startup_cost, input_total_cost,
rel->tuples); pathnode->path.rows);
return pathnode; return pathnode;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment