Skip to content

Commit

Permalink
statistics: reduce dumpStatsMaxDuration as 5min (pingcap#56538) (ping…
Browse files Browse the repository at this point in the history
  • Loading branch information
ti-chi-bot authored Oct 22, 2024
1 parent 963344f commit cc04dd7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions statistics/handle/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ var (
// DumpStatsDeltaRatio is the lower bound of `Modify Count / Table Count` for stats delta to be dumped.
DumpStatsDeltaRatio = 1 / 10000.0
// dumpStatsMaxDuration is the max duration since last update.
dumpStatsMaxDuration = time.Hour
dumpStatsMaxDuration = 5 * time.Minute
)

// needDumpStatsDelta checks whether to dump stats delta.
Expand All @@ -427,7 +427,7 @@ func (h *Handle) needDumpStatsDelta(is infoschema.InfoSchema, mode dumpMode, id
item.InitTime = currentTime
}
if currentTime.Sub(item.InitTime) > dumpStatsMaxDuration {
// Dump the stats to kv at least once an hour.
// Dump the stats to kv at least once 5 minutes.
return true
}
statsTbl := h.GetPartitionStats(tbl.Meta(), id)
Expand Down

0 comments on commit cc04dd7

Please sign in to comment.