Will dropping a large log table quickly free up space in storage?

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

Original topic: drop大的日志表,存储上面会很快释放空间吗?

| username: TiDBer_Y2d2kiJh

[TiDB Usage Environment] Production Environment / Testing / PoC
[TiDB Version] v5.4.0 3tidb 3pd 3tikv
[Reproduction Path] What operations were performed when the issue occurred
[Encountered Issue: Issue Phenomenon and Impact]
[Resource Configuration] Go to TiDB Dashboard - Cluster Info - Hosts and take a screenshot of this page
[Attachments: Screenshots/Logs/Monitoring]
Planning to drop a large log table with approximately 200 million records. I would like to know the principle of the drop operation. After dropping, will the storage space be released quickly?

| username: TIDB-Learner | Original post link

Excerpt from the official documentation:
In TiDB, using `DELETE`, `TRUNCATE`, and `DROP` statements to delete data will not immediately release space. For `TRUNCATE` and `DROP` operations, after reaching TiDB's GC (garbage collection) time (default 10 minutes), TiDB's GC mechanism will delete the data and release the space. For `DELETE` operations, TiDB's GC mechanism will delete the data but will not immediately release the space; instead, the space will be released during subsequent compaction.

| username: Kongdom | Original post link

It will not be released immediately; it will wait for the GC time and be cleaned up and released by the GC mechanism.

| username: jiayou64 | Original post link

There will be no GC mechanism.

| username: 呢莫不爱吃鱼 | Original post link

It depends on the GC time you set.

| username: 成为一名优秀的DBA | Original post link

Executing the drop operation will not immediately release disk space.

| username: 洪七表哥 | Original post link

Need to wait for GC to finish.

| username: zhaokede | Original post link

It will not be released immediately;
This is also a protection mechanism that allows time for regret and data recovery.

| username: vincentLi | Original post link

It won’t be cleaned up immediately, the advantage is that it can provide snapshot queries.

| username: 濱崎悟空 | Original post link

Generally, it won’t be immediate.

| username: 濱崎悟空 | Original post link

Waiting for GC time

| username: zhanggame1 | Original post link

Drop releases very quickly, it is released as soon as the GC time arrives.

| username: TiDBer_7S8XqKfl-1158 | Original post link

It definitely won’t be immediate; GC needs to be scheduled.

| username: zhaokede | Original post link

GC time to reclaim space

| username: awakening | Original post link

Not immediately

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

Does dropping the log table affect the cluster? I have a table with over ten terabytes that also needs to be dropped.

| username: TiDBer_TQXaqJ6U-6236 | Original post link

Space will definitely not be released immediately, as PD scheduling takes time.

| username: TiDBer_7S8XqKfl-1158 | Original post link

The space is unlikely to be released immediately.

| username: TiDB-ruiqianyun | Original post link

Need to wait for GC to finish.

| username: 濱崎悟空 | Original post link

Wait for GC time