Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.Original topic: 一个非常简单的SQL耗时16分钟,但查看“执行时间”,看不到具体时间消耗在哪里,sql:ANALYZE TABLE XXX
To improve efficiency, please provide the following information. A clear problem description can help resolve the issue faster:
[TiDB Usage Environment]
Production Environment
[Overview] Scenario + Problem Overview
The cluster suddenly became slow. By checking the slow logs, I found a very strange SQL. It was just an ANALYZE, but it took more than ten minutes.
The execution time is as follows:
[Background] Operations performed
[Phenomenon] Business and database phenomena
[Problem] Current issue encountered
[Business Impact]
[TiDB Version]
5.2.1
[Application Software and Version]
[Attachments] Relevant logs and configuration information
- TiUP Cluster Display information
- TiUP Cluster Edit config information
Monitoring (https://metricstool.pingcap.com/)
- TiDB-Overview Grafana monitoring
- TiDB Grafana monitoring
- TiKV Grafana monitoring
- PD Grafana monitoring
- Corresponding module logs (including logs 1 hour before and after the issue)
If the question is related to performance optimization or troubleshooting, please download the script and run it. Please select all and copy-paste the terminal output results and upload them.