Skip to content

Commit

Permalink
statistics: fix a calculation logic flaw in (*Index).GetRowCount (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
time-and-fate authored Jan 12, 2023
1 parent b8e5460 commit 8af1250
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions statistics/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ func (idx *Index) GetRowCount(sctx sessionctx.Context, coll *HistColl, indexRang
if expBackoffCnt > upperLimit {
expBackoffCnt = upperLimit
}
totalCount += expBackoffCnt
count += expBackoffCnt
}
}
if !expBackoffSuccess {
Expand All @@ -310,7 +310,7 @@ func (idx *Index) GetRowCount(sctx sessionctx.Context, coll *HistColl, indexRang

// handling the out-of-range part
if (idx.outOfRange(l) && !(isSingleCol && lowIsNull)) || idx.outOfRange(r) {
totalCount += idx.Histogram.outOfRangeRowCount(&l, &r, modifyCount)
count += idx.Histogram.outOfRangeRowCount(&l, &r, modifyCount)
}
totalCount += count
}
Expand Down

0 comments on commit 8af1250

Please sign in to comment.