TiDB Dashboard Slow Query Page Filters Slow Statements Very Slowly

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

Original topic: tidb dasboard 慢查询页面筛选慢语句好慢

| username: heiwandou

[TiDB Usage Environment] Production Environment
[TiDB Version] 6.5.2
[Reproduction Path] Enter TiDB Dashboard - Slow Query page, it is very slow to count the slow queries that occurred in the last 30 minutes (it was fine before, but after adjusting the slow log threshold to 1 second, it sometimes becomes very slow, and the slow log does not appear as shown in the picture below

[Encountered Problem: Problem Phenomenon and Impact]

| username: xfworld | Original post link

What is the cluster configuration? Are there any anomalies in the PD nodes providing the dashboard? Check the logs.

| username: heiwandou | Original post link

Should I check the PD or TiDB logs if the PD nodes and TiDB share 3 nodes, with a cluster configuration of 8 cores and 16GB (low load)?

| username: Soysauce520 | Original post link

Is the adjustment of 1s done by each instance or is it a global setting used in a session?

| username: heiwandou | Original post link

In a session, I executed a global setting and found that it didn’t change on other instances, so I set it globally on each instance.

| username: 像风一样的男子 | Original post link

Have you not cleaned up the TiDB slow SQL logs for a long time? Accumulating too many logs can slow down the queries.

| username: yeminhua | Original post link

It might be that after your adjustments, there are a lot more slow SQL logs. Check the log size and clean them up regularly.

| username: tidb菜鸟一只 | Original post link

Go to the slowlog directory on each TiDB server host and either back up the historical logs or delete them directly.