1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-30 11:03:19 +03:00

Finish refactoring make_foo() functions in createplan.c.

This patch removes some redundant cost calculations that I left for later
cleanup in commit 3fc6e2d7f5.  There's now a uniform policy that the
make_foo() convenience functions don't do any cost calculations.  Most of
their callers copy costs from the source Path node, and for those that
don't, the calculation in the make_foo() function wasn't necessarily right
anyhow.  (make_result() was particularly a mess, as it was serving multiple
callers using cost calcs designed for only the first one or two that had
ever existed.)  Aside from saving a few cycles, this ensures that what
EXPLAIN prints matches the costs we used for planning purposes.  It does
not change any planner decisions, since the decisions are already made.
This commit is contained in:
Tom Lane
2016-03-08 16:28:27 -05:00
parent 7400559a3f
commit 8c314b9853
5 changed files with 201 additions and 249 deletions

View File

@ -3143,7 +3143,7 @@ create_grouping_paths(PlannerInfo *root,
while (--nrows >= 0)
{
path = (Path *)
create_result_path(grouped_rel,
create_result_path(root, grouped_rel,
target,
(List *) parse->havingQual);
paths = lappend(paths, path);
@ -3159,7 +3159,7 @@ create_grouping_paths(PlannerInfo *root,
{
/* No grouping sets, or just one, so one output row */
path = (Path *)
create_result_path(grouped_rel,
create_result_path(root, grouped_rel,
target,
(List *) parse->havingQual);
}