Skip to content

Commit cfb9c68

Browse files
committed
adjust coster to use seqIOCostFactor
1 parent c7748f7 commit cfb9c68

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sql/memo/coster.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,11 @@ func (c *coster) costRel(ctx *sql.Context, n RelExpr, s sql.StatsProvider) (floa
136136
expectedRightRows := selfJoinCard * matchRate
137137

138138
if expectedRightRows < lBest {
139-
return lBest*(seqIOCostFactor) + (lBest + indexCoverageAdjustment(n.Lookup)*(cpuCostFactor+randIOCostFactor)), nil
139+
return lBest*(seqIOCostFactor) + (lBest + indexCoverageAdjustment(n.Lookup)*(seqIOCostFactor+randIOCostFactor)), nil
140140
}
141141

142142
// Estimate for reading each left row and each expected right row
143-
return lBest*seqIOCostFactor + expectedRightRows*(cpuCostFactor+randIOCostFactor), nil
143+
return lBest*seqIOCostFactor + expectedRightRows*(seqIOCostFactor+randIOCostFactor), nil
144144
case *ConcatJoin:
145145
return c.costConcatJoin(ctx, n, s)
146146
}

0 commit comments

Comments
 (0)