In the production environment, the disk space is limited. I deleted a large table index, and the index usage has dropped from 3T to 1.56T, but the corresponding TiKV disk space has not been released. My GC setting is 10 minutes, and it has already exceeded 10 minutes. Should I use ALTER TABLE xxx ANALYZE; to release the disk space?
Normally, cleanup starts after GC, and it takes some time. If it hasn’t been cleaned for a long time, you need to check if there is an issue with GC. You can check the tidb.log file. It is most likely a bug.
The ANALYZE TABLE command can improve the accuracy of table statistics, which is essential for SQL logical and physical optimization processes, but it cannot release data.
I checked that there are no records in gc_delete_range_done, but there are records in gc_delete_range. I don’t know when gc_delete_range_done will have records; it might be due to manual operations.
Because these spaces are very likely to be reused, the release is relatively slow. Secondly, deleting on an SSD can actually affect its performance, so the deletion process will be very slow.