planner: new metrics to track Analyze concurrency
- Dominant language
- Go
- Stars
- 40.5k
- Forks
- 6.2k
- PR merge metrics
- PR metrics pending
Description
## Enhancement
`Analyze` command could impact the performance of both TiKV and TiDB, but we don't have a metric to track its concurrency.
For TiKV, full table scans triggered by `Analyze` might slow down TiKV performance. (Please see pic1 below)
For TiDB, `Analyze` might cause high CPU and memory pressures. (Please see pic2 below)
If the `Analyze` concurrency is too high, some queries could become slower because of its impact. But now we don't have such a metric that can tell us `Analyze` concurrency on each TiDB and the whole cluster.
We should have a metric to track its concurrency like pic3. Then if in a particular period of time, there are some slow query, or the TiDB CPU/Meory is unexpectedly high, or the TiKV is unexpected slow, we could take a look at this metric. If there time periods can match, then we could know it's probably caused by the high `Analyze` concurrency.
Contributor guide
Assessment
This issue has not been assessed yet.