Issues Related to Quickly Deleting Large Amounts of Data

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

Original topic: 关于快速删除大量数据的问题

| username: 健康的腰间盘

[Test Environment for TiDB] Testing
[TiDB Version] 5.7.25-TiDB-v7.1.1
[Reproduction Path] Data written through Bulk Copy cannot be rolled back in TiDB. How to quickly delete a large amount of data manually? Loop deletion is also slow. Are there any other solutions?
[Problem Encountered: Significantly affects business processing speed]

| username: zhanggame1 | Original post link

The main purpose of partitioned tables is to quickly delete data. Consider using partitioned tables for storage.

| username: 健康的腰间盘 | Original post link

Thank you for your reply. Since SQL Server perfectly supports Bulk Copy and can roll back, I didn’t use partitioning in the entire table design. Now I want to see if there’s a good way to solve this problem without modifying the table structure. :heart_eyes:

| username: redgame | Original post link

TRUNCATE or Lightning

| username: Raymond | Original post link

Don’t use the delete limit method to delete, as this will cause the deletion to become slower and slower. If you cannot adjust the table structure, you can use the official non-transactional DML statements.

| username: gcworkerishungry | Original post link

Additionally, you can refer to: TiDB 最佳实践 | PingCAP 文档中心

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.