Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: 想问一下,如果把表删了,磁盘空间会立即释放吗?如果不会释放应该怎么才能把空间给释放出来
I would like to ask, if a table is deleted, will the disk space be immediately released? If not, how can the space be released?
No, you need to wait for GC. You can speed up the GC process by configuring these parameters:
It will not be released immediately.
Generally, it waits for GC, and the space will be released after GC is completed.
Are those .sst files in TiKV the data files of the table? After GC is completed, are these .sst files removed or how are they released?
Yes, the underlying layer of TiKV is RocksDB, and SST files are the data files of RocksDB.
The MVCC mechanism will not release immediately.
I observed that there aren’t many SST files in the db directory, and they aren’t very large. The folder that takes up the most space is the raft engine folder.
When a table is deleted, the disk space is not immediately released because TiDB uses an MVCC (Multi-Version Concurrency Control) storage engine, and the deleted data may still be referenced by other transactions.
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.