Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: TIDB自身的慢SQL优化
[TiDB Usage Environment] Production Environment
[TiDB Version] 5.2.1
[Encountered Problem: Phenomenon and Impact]
The dashboard shows many slow SQL queries generated by the system itself, as shown below.
How can this be optimized?
You can clean up the slow SQL logs. Over time, they accumulate too much, which will definitely slow down the queries. The logs are located in the log folder under the TiDB node on the server.
I have already cleaned up the slow_query_log-xxx.
Maybe you can check the execution plan. If the execution plan is not as expected, you can request modifications.
Check the execution plan; the digest column should have an index.
It does not affect usage, no optimization needed.
Earlier lower versions may have this issue. If it does not interfere with business, it can be ignored. If it has an impact, consider upgrading to a higher version.
This can only be upgraded, right? I wonder if SQL Binding can be used.