Skip to content

Commit

Permalink
add concurrently-init-stats
Browse files Browse the repository at this point in the history
Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>
  • Loading branch information
hawkingrei committed May 13, 2024
1 parent 9483842 commit 5d98c16
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions pkg/executor/analyze.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,16 @@ TASKLOOP:
dom.SysProcTracker().KillSysProcess(dom.GetAutoAnalyzeProcID())
})
// If we enabled dynamic prune mode, then we need to generate global stats here for partition tables.
if needGlobalStats && e.notEmpty.Load() {
err = e.handleGlobalStats(ctx, globalStatsMap)
if err != nil {
return err
if needGlobalStats {
if e.notEmpty.Load() {
err = e.handleGlobalStats(ctx, globalStatsMap)
if err != nil {
return err
}
} else {
for globalStatsID := range globalStatsMap {
statsHandle.SaveMetaToStorage(globalStatsID.tableID, 0, 0, handleutil.StatsMetaHistorySourceAnalyze)
}
}
}

Expand Down

0 comments on commit 5d98c16

Please sign in to comment.