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

Commit98369eb

Browse files
committed
remove step
1 parent306b239 commit98369eb

File tree

1 file changed

+4
-38
lines changed

1 file changed

+4
-38
lines changed

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

Lines changed: 4 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1983,7 +1983,6 @@ compute_cpu_sort_cost(PlannerInfo *root, List *pathkeys, int nPresortedKeys,
19831983
doubletotalFuncCost=1.0;
19841984
boolhas_fake_var= false;
19851985
inti=0;
1986-
Oidprev_datatype=InvalidOid;
19871986
List*cache_varinfos=NIL;
19881987

19891988
/* fallback if pathkeys is unknown */
@@ -2011,50 +2010,17 @@ compute_cpu_sort_cost(PlannerInfo *root, List *pathkeys, int nPresortedKeys,
20112010
*/
20122011
foreach(lc,pathkeys)
20132012
{
2014-
PathKey*pathkey= (PathKey*)lfirst(lc);
2015-
EquivalenceMember*em;
2016-
doublenGroups,
2017-
correctedNGroups;
2018-
CostfuncCost=1.0;
2013+
PathKey*pathkey= (PathKey*)lfirst(lc);
2014+
EquivalenceMember*em;
2015+
doublenGroups,
2016+
correctedNGroups;
20192017

20202018
/*
20212019
* We believe that equivalence members aren't very different, so, to
20222020
* estimate cost we consider just the first member.
20232021
*/
20242022
em= (EquivalenceMember*)linitial(pathkey->pk_eclass->ec_members);
20252023

2026-
if (em->em_datatype!=InvalidOid)
2027-
{
2028-
/* do not lookup funcCost if the data type is the same */
2029-
if (prev_datatype!=em->em_datatype)
2030-
{
2031-
Oidsortop;
2032-
QualCostcost;
2033-
2034-
sortop=get_opfamily_member(pathkey->pk_opfamily,
2035-
em->em_datatype,em->em_datatype,
2036-
pathkey->pk_strategy);
2037-
2038-
cost.startup=0;
2039-
cost.per_tuple=0;
2040-
add_function_cost(root,get_opcode(sortop),NULL,&cost);
2041-
2042-
/*
2043-
* add_function_cost returns the product of cpu_operator_cost
2044-
* and procost, but we need just procost, co undo that.
2045-
*/
2046-
funcCost=cost.per_tuple /cpu_operator_cost;
2047-
2048-
prev_datatype=em->em_datatype;
2049-
}
2050-
}
2051-
2052-
/* factor in the width of the values in this column */
2053-
funcCost *=get_width_cost_multiplier(root,em->em_expr);
2054-
2055-
/* now we have per-key cost, so add to the running total */
2056-
totalFuncCost+=funcCost;
2057-
20582024
/* remember if we have found a fake Var in pathkeys */
20592025
has_fake_var |=is_fake_var(em->em_expr);
20602026
pathkeyExprs=lappend(pathkeyExprs,em->em_expr);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp