Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.Original topic: tidb删除大表
TiDB version: 5.0.3
Are there any precautions to take when deleting several large tables around 1TB?
Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.Original topic: tidb删除大表
TiDB version: 5.0.3
Are there any precautions to take when deleting several large tables around 1TB?
If it’s a full table deletion, truncate table is very fast.
Both drop and truncate can be used. Pay attention to whether the downstream is functioning properly and whether the space is being reclaimed.
If it is a delete, be sure to delete in batches. If it is a truncate or drop, you can delete directly.
When deleting a large table, in addition to considering whether the GC period is a business peak, you also need to be aware that the deletion of a large table will suddenly create many empty regions. By monitoring PD in Grafana, you will see a significant increase in the empty-region-count in the Region health monitoring item. Empty regions can interfere with PD scheduling, so you need to manually merge empty regions at this time. Therefore, the operation of deleting a large table should be performed during off-peak business hours, and region merge should be done immediately after deletion.
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.