TiDB Accelerated Table Creation
TiDB v7.6.0 introduces the system variable tidb_ddl_version
to support accelerating table creation, which improves the efficiency of bulk table creation. Starting from v8.0.0, this system variable is renamed to tidb_enable_fast_create_table
.
When accelerated table creation is enabled via tidb_enable_fast_create_table
, table creation statements with the same schema committed to the same TiDB node at the same time are merged into batch table creation statements to improve table creation performance. Therefore, to improve the table creation performance, try to connect to the same TiDB node, create tables with the same schema concurrently, and increase the concurrency appropriately.
The merged batch table creation statements are executed within the same transaction, so if one statement of them fails, all of them will fail.
Compatibility with TiDB tools
- TiCDC does not support replicating the tables that are created by
tidb_enable_fast_create_table
.
Limitation
You can now use performance optimization for table creation only in the CREATE TABLE
statement, and this statement must not include any foreign key constraints.
Use tidb_enable_fast_create_table
to accelerate table creation
You can enable or disable performance optimization for creating tables by specifying the value of the system variable tidb_enable_fast_create_table
.
To enable performance optimization for creating tables, set the value of this variable to ON
:
SET GLOBAL tidb_enable_fast_create_table = ON;
To disable performance optimization for creating tables, set the value of this variable to OFF
:
SET GLOBAL tidb_enable_fast_create_table = OFF;