package
9.0.0-alpha+incompatible
Repository: https://github.com/pingcap/tidb.git
Documentation: pkg.go.dev
# Functions
CheckAutoAnalyzeWindow determine the time window for auto-analysis and verify if the current time falls within this range.
CleanupCorruptedAnalyzeJobsOnCurrentInstance cleans up the potentially corrupted analyze job from current instance.
CleanupCorruptedAnalyzeJobsOnDeadInstances cleans up the potentially corrupted analyze job from dead instances.
NeedAnalyzeTable checks if we need to analyze the table: 1.
NewStatsAnalyze creates a new StatsAnalyze.
RandomPickOneTableAndTryAutoAnalyze randomly picks one table and tries to analyze it.
# Constants
BatchUpdateAnalyzeJobSQL is the SQL to update the analyze jobs to `failed` state.
SelectAnalyzeJobsOnCurrentInstanceSQL is the SQL to select the analyze jobs whose state is `pending` or `running` and the update time is more than 10 minutes ago and the instance is current instance.
SelectAnalyzeJobsSQL is the SQL to select the analyze jobs whose state is `pending` or `running` and the update time is more than 10 minutes ago.