After executing DDL, the performance cannot be restored. Should compaction be done and how to do it?

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

Original topic: 执行完ddl后性能回不去了,是不是要做compaction怎么做?

| username: 数据源的TiDB学习之路

[TiDB Usage Environment] Production Environment / Testing / PoC
[TiDB Version]
[Reproduction Path] Run sysbench, then perform an operation to reduce the field length of the table. After the DDL is completed, the performance does not return to normal.
[Encountered Problem: Problem Phenomenon and Impact] It is understood that compaction should be done, but how to perform compaction on TiKV data?
[Resource Configuration] Go to TiDB Dashboard - Cluster Info - Hosts and take a screenshot of this page
[Attachment: Screenshot/Log/Monitoring]

| username: zhanggame1 | Original post link

Execute with caution. You can reduce --threads=32, and ensure there is enough free disk space.

tiup ctl:v7.5.1 tikv --pd 127.0.0.1:2379 compact-cluster -d kv --bottommost force -c write --threads=32 
tiup ctl:v7.5.1 tikv --pd 127.0.0.1:2379 compact-cluster -d kv --bottommost force -c default --threads=32
| username: 数据源的TiDB学习之路 | Original post link

Thank you, boss.
I would like to ask, what is the difference between my command below and your two commands?
tiup ctl:v7.5.1 tikv --pd 10.17.3.151:2379 compact-cluster

| username: zhanggame1 | Original post link

Half of the TiKV data is in writeCF and the other half is in defaultCF, so it needs to be processed twice for the two CFs.

| username: 数据源的TiDB学习之路 | Original post link

Thank you.

I saw the documentation described here: TiKV Control User Guide | PingCAP Documentation Center

| username: 数据源的TiDB学习之路 | Original post link

May I ask where in Grafana can I see charts showing the compact status?

| username: zhanggame1 | Original post link

image