Skip to content

Latest commit

 

History

History
41 lines (26 loc) · 2.57 KB

accelerated-table-creation.md

File metadata and controls

41 lines (26 loc) · 2.57 KB
title summary aliases
TiDB Accelerated Table Creation
Learn the concept, principles, and implementation details of performance optimization for creating tables in TiDB.
/tidb/dev/ddl-v2/

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.

Warning:

This feature is currently an experimental feature and it is not recommended to use in a production environment. This feature might change or be removed without prior notice. If you find a bug, please give feedback by raising an issue on GitHub.

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;