Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: 如何清理CLUSTER_SLOW_QUERY表v4.0.14
[TiDB Usage Environment] Production Environment / Testing / PoC
[TiDB Version] v4.0.14
[Reproduction Path] What operations were performed when the issue occurred
[Encountered Issue: Issue Phenomenon and Impact] How to clean up records in the INFORMATION_SCHEMA.CLUSTER_SLOW_QUERY table
[Resource Configuration] Enter TiDB Dashboard - Cluster Info - Hosts and take a screenshot of this page
[Attachments: Screenshots/Logs/Monitoring]
Does your version have this table? I recommend upgrading the version. The version is too old.
This table maps to the tidb-server’s tidb slow log file. You can just delete the slow log file.
Just remove the slow log on each TiDB node.
The version is written incorrectly; it should be v5.0.4. Upgrading the version is not possible at the moment.
TiDB 配置文件描述 | PingCAP 归档文档站 You can add parameters to limit the size.
Don’t check for too long, lower versions are prone to OOM.
So either upgrade or use parameters to limit it.
After backing up, directly delete the slow log file
SHOW config WHERE NAME LIKE '%slow-query-file%';
I remember it can be deleted directly.
Yes, the table is empty after deletion.
This should be an external table, which cannot be truncated or dropped. 
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.