How to Clean the CLUSTER_SLOW_QUERY Table in v4.0.14

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: 如何清理CLUSTER_SLOW_QUERY表v4.0.14

| username: Hacker_lBbigVlk

[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]

| username: WalterWj | Original post link

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.

| username: Miracle | Original post link

Just remove the slow log on each TiDB node.

| username: Hacker_lBbigVlk | Original post link

The version is written incorrectly; it should be v5.0.4. Upgrading the version is not possible at the moment.

| username: Soysauce520 | Original post link

TiDB 配置文件描述 | PingCAP 归档文档站 You can add parameters to limit the size.

| username: buddyyuan | Original post link

Don’t check for too long, lower versions are prone to OOM.
So either upgrade or use parameters to limit it.

| username: 江湖故人 | Original post link

After backing up, directly delete the slow log file
SHOW config WHERE NAME LIKE '%slow-query-file%';

| username: TiDBer_aaO4sU46 | Original post link

I remember it can be deleted directly.

| username: 江湖故人 | Original post link

Yes, the table is empty after deletion.
This should be an external table, which cannot be truncated or dropped. :thinking:

| username: redgame | Original post link

You can delete it.

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.