Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3fd19a9

Browse files
committed
Minor adjustments to WindowAgg startup cost code
This is a follow-on of3900a02 containing some changes which I forgotto commit locally before forming a patch with git format-patch.Discussion:https://postgr.es/m/CAApHDvrB0S5BMv+0-wTTqWFE-BJ0noWqTnDu9QQfjZ2VSpLv_g@mail.gmail.com
1 parent3900a02 commit3fd19a9

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

‎src/backend/optimizer/path/costsize.c

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2933,8 +2933,8 @@ get_windowclause_startup_tuples(PlannerInfo *root, WindowClause *wc,
29332933
* NULLs are not allowed, but currently, there's no code to
29342934
* error out if there's a NULL Const. We'll only discover
29352935
* this during execution. For now, just pretend everything is
2936-
* fine and assume that just thecurrent row/range/group will
2937-
*beneeded.
2936+
* fine and assume that just thefirst row/range/group will be
2937+
* needed.
29382938
*/
29392939
end_offset_value=1.0;
29402940
}
@@ -3055,15 +3055,6 @@ cost_windowagg(Path *path, PlannerInfo *root,
30553055
startup_cost=input_startup_cost;
30563056
total_cost=input_total_cost;
30573057

3058-
/*
3059-
* Estimate how many tuples we'll need to read from the subnode before we
3060-
* can output the first WindowAgg row.
3061-
*/
3062-
startup_tuples=get_windowclause_startup_tuples(root,winclause,
3063-
input_tuples);
3064-
3065-
elog(DEBUG1,"startup_tuples = %g",startup_tuples);/* XXX not for commit */
3066-
30673058
/*
30683059
* Window functions are assumed to cost their stated execution cost, plus
30693060
* the cost of evaluating their input expressions, per tuple. Since they
@@ -3124,6 +3115,9 @@ cost_windowagg(Path *path, PlannerInfo *root,
31243115
* cost of the subnode, so we only need to do this when the estimated
31253116
* startup tuples is above 1.0.
31263117
*/
3118+
startup_tuples=get_windowclause_startup_tuples(root,winclause,
3119+
input_tuples);
3120+
31273121
if (startup_tuples>1.0)
31283122
path->startup_cost+= (total_cost-startup_cost) /input_tuples*
31293123
(startup_tuples-1.0);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp