tencent cloud

TencentDB for MySQL

Release Notes and Announcements
Release Notes
Product Announcements
User Tutorial
Product Introduction
Overview
Strengths
Use Cases
Database Architecture
Resource Isolation Policy
Economical Instance
Feature List
Database Instance
High Availability (Multi-AZ)
Regions and AZs
Service Regions and Service Providers
Kernel Features
Overview
Kernel Version Release Notes
Functionality Features
Performance Features
Security Features
Stability Features
TXRocks Engine
LibraDB Engine
Checking and Fixing Kernel Issues
Purchase Guide
Billing Overview
Selection Guide
Purchase Methods
Renewal
Payment Overdue
Refund
Pay-as-You-Go to Monthly Subscription
Instance Adjustment Fee
Backup Space Billing
Database Audit Billing Overview
Commercial Billing and Activity Description for Database Proxy
Description of the Database Proxy Billing Cycle
Viewing Bills
Getting Started
Overview
Creating MySQL Instance
Connecting to MySQL Instance
SQL Insight (Database Audit)
Overview
Viewing Audit Instance List
Enabling Audit Service
Viewing Audit Log
Log Shipping
Configuring Post-Event Alarms
Modifying Audit Rule
Modifying Audit Services
Disabling Audit Service
Audit Rule Template
SQL Audit Rule (Legacy)
Viewing Audit Task
Authorizing Sub-User to Use Database Audit
MySQL Cluster Edition
Introduction to TencentDB for MySQL Cluster Edition
Creating TencentDB for MySQL Cluster Edition Instance
Maintenance Management Instance
Viewing Instance Monitoring
Adjusting Instance Configuration
Operations for Other Features
Migrate or upgrade to TencentDB for MySQL Cluster Edition
Operation Guide
Use Limits
Operation Overview
Instance Management and Maintenance
Instance Upgrade
CPU Elastic Expansion
Read-Only/Disaster Recovery Instances
Database Proxy
Database Management Center (DMC)
Account Management
Parameter Configuration
Backup and Rollback
Data Migration
Network and Security
Monitoring and Alarms
Log Center
Read-Only Analysis Engine
Tag
Practical Tutorial
Using TencentDB for MySQL to Upgrade MySQL 5.7 to MySQL 8.0
Methods and Instructions for Upgrading from MySQL 5.6 to MySQL 5.7
Cybersecurity Classified Protection Practice for Database Audit of TencentDB for MySQL
Building All-Scenario High-Availability Architecture
Usage Specifications of TencentDB for MySQL
Configuring Automatic Application Reconnection
Impact of Modifying MySQL Source Instance Parameters
Limits on Automatic Conversion from MyISAM to InnoDB
Creating VPCs for TencentDB for MySQL
Enhancing Business Load Capacity with TencentDB for MySQL
Setting up 2-Region-3-DC Disaster Recovery Architecture
Improving TencentDB for MySQL Performance with Read/Write Separation
Migrating Data from InnoDB to RocksDB with DTS
Building LAMP Stack for Web Application
Building Drupal Website
Calling MySQL APIs in Python
The primary and secondary instances have inconsistent query data
White Paper
Performance White Paper
Security White Paper
Troubleshooting
Connections
Performance
Instance Data Sync Delay
Failure to Enable Case Insensitivity
Failure to Obtain slow_query_log_file via a Command
API Documentation
History
Introduction
API Category
Instance APIs
Making API Requests
Data Import APIs
Database Proxy APIs
Database Audit APIs
Security APIs
Task APIs
Backup APIs
Account APIs
Rollback APIs
Parameter APIs
Database APIs
Monitoring APIs
Log-related API
Data Types
Error Codes
FAQs
Related to Selection
Billing
Backup
Rollback
Connection and Login
Parameter Modifications
Instance Upgrade
Account Permissions
Performance and Memory
Ops
Data Migration
Features
Console Operations
Logs
Event
Database audit
Instance Switch Impact
API 2.0 to 3.0 Switch Guide
Service Agreement
Service Level Agreement
Terms of Service
Reference
Standards and Certifications
Contact Us
Glossary

Async Deletion of Big Tables

PDF
Focus Mode
Font Size
Last updated: 2025-09-25 09:47:53

Overview

This feature is used to drop tables with large data files to avoid I/O fluctuation.
When the DROP TABLE operation is performed, the system will first rename the original database file (.ibd) to make a new temporary file and then returns the message of successful operation promptly. The temporary file is stored in the directory specified by the innodb_async_drop_tmp_dir parameter and is truncated in batches by the system in the backend. The size of the file to be truncated each time is specified by the innodb_async_truncate_size parameter (supported in MySQL 5.7 and 8.0 but not 5.6).
Users do not need to perform this operation. Instead, it is automatically completed by the kernel. Principle: A hard link is created in another directory for the data file of a table when the table is dropped. As a result, when DROP TABLE is executed, only the hard link to the file is deleted. After that, the backend thread will scan files that need to be deleted in the hard-linked directory and automatically truncate the data file of the dropped table.

Supported Versions

Kernel version: MySQL 5.6 20220303 and later.
Kernel version: MySQL 5.7 20230601 and later.
Kernel version: MySQL 8.0 20200630 and later.

Use Cases

This feature is used to drop tables with large data files.

Instructions

For MySQL 5.6, you can set the innodb_async_truncate_work_enabled parameter to ON to enable the async mode of DROP TABLE. The default value is OFF.
For MySQL 5.7 and 8.0, you can set the innodb_table_drop_mode parameter to ASYNC_DROP to enable the async mode of DROP TABLE. The default value is ASYNC_DROP.
The size of the file to be truncated each time is specified by the innodb_async_truncate_size parameter. This is not supported for MySQL 5.6.
You can make the async drop of big tables more efficient by enabling the innodb_fast_ddl parameter as instructed in FAST DDL.
Instructions for MySQL 5.6
Instructions for MySQL 5.7 and 8.0

Steps to Enable the Feature

1. Before you use the feature of asynchronous big table deletion, set the parameter innodb_adaptive_hash_index to OFF.
2. Set the parameter innodb_async_truncate_work_enabled to ON to enable the feature of asynchronous big table deletion. For parameter settings, see Setting Instance Parameters.

Relevant Parameters

Parameter Name
Dynamic
Type
Default
Value Range
Description
innodb_adaptive_hash_index
yes
string
ON
ON/OFF
Whether to enable InnoDB adaptive hash index.
ON: Enable.
OFF: Disable.
innodb_async_truncate_work_enabled
yes
string
OFF
ON/OFF
Whether to enable asynchronous big table deletion.
ON: Enable.
OFF: Disable.

Steps to Enable the Feature

1. Before you use the feature of asynchronous big table deletion, set the parameter innodb_fast_ahi_cleanup_for_drop_table to ON.
2. Set the parameter innodb_adaptive_hash_index to OFF.
3. Set the parameter innodb_table_drop_mode to ASYNC_DROP to enable the feature of asynchronous big table deletion. For parameter settings, see Setting Instance Parameters.
4. (Optional) Set the parameter innodb_fast_ddl to ON, which can make asynchronous big table deletion more efficient. The FAST DDL feature and relevant parameters are involved. For details, see FAST DDL.

Relevant Parameters

Parameter Name
Dynamic
Type
Default
Value Range
Description
innodb_fast_ahi_cleanup_for_drop_table
yes
string
ON
ON/OFF
Whether to enable quick cleanup optimization for adaptive hash indexes.
ON: Enable. Once it is enabled, it can prevent big table deletion from being blocked due to slow hash index cleanup.
OFF: Disable.
innodb_adaptive_hash_index
yes
string
OFF
ON/OFF
Whether to enable InnoDB adaptive hash index.
ON: Enable.
OFF: Disable.
innodb_table_drop_mode
yes
string
ASYNC_DROP
SYNC_DROP/ASYNC_DROP
Whether to enable asynchronous big table deletion.
ASYNC_DROP: Asynchronous mode. This value indicates that asynchronous big table deletion is enabled.
SYNC_DROP: Synchronous mode. This value indicates that asynchronous big table deletion is disabled.
innodb_async_truncate_size
yes
int
128
128 - 168
Size of the file to be truncated each time in the backend during asynchronous big table deletion, in MB.


Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback