Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

domain: add a config to control updating stats #10772

Merged
merged 5 commits into from
Jun 19, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ type Performance struct {
TCPKeepAlive bool `toml:"tcp-keep-alive" json:"tcp-keep-alive"`
CrossJoin bool `toml:"cross-join" json:"cross-join"`
StatsLease string `toml:"stats-lease" json:"stats-lease"`
UpdateStats bool `toml:"update-stats" json:"update-stats"`
EnableUpdateStats bool `toml:"enable-update-stats" json:"enable-update-stats"`
RunAutoAnalyze bool `toml:"run-auto-analyze" json:"run-auto-analyze"`
StmtCountLimit uint `toml:"stmt-count-limit" json:"stmt-count-limit"`
FeedbackProbability float64 `toml:"feedback-probability" json:"feedback-probability"`
Expand Down Expand Up @@ -322,7 +322,7 @@ var defaultConf = Config{
TCPKeepAlive: true,
CrossJoin: true,
StatsLease: "3s",
UpdateStats: true,
EnableUpdateStats: true,
RunAutoAnalyze: true,
StmtCountLimit: 5000,
FeedbackProbability: 0.05,
Expand Down
4 changes: 2 additions & 2 deletions config/config.toml.example
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ cross-join = true
# Stats lease duration, which influences the time of analyze and stats load.
stats-lease = "3s"

# Whether run stats updates on this tidb-server.
update-stats = true
# Whether run stats updates on this tidb-server. It will only updates stats when stats-lease is non-zero.
alivxxx marked this conversation as resolved.
Show resolved Hide resolved
enable-update-stats = true

# Run auto analyze worker on this tidb-server.
run-auto-analyze = true
Expand Down
2 changes: 1 addition & 1 deletion domain/domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -839,7 +839,7 @@ func (do *Domain) UpdateTableStatsLoop(ctx sessionctx.Context) error {
}
do.wg.Add(1)
go do.loadStatsWorker()
if !config.GetGlobalConfig().Performance.UpdateStats {
if !config.GetGlobalConfig().Performance.EnableUpdateStats {
return nil
}
owner := do.newStatsOwner()
Expand Down