From 613b09c72cb596f4254c9ed5ab3c391af1c1195e Mon Sep 17 00:00:00 2001 From: gmhdbjd Date: Wed, 20 Mar 2024 14:17:20 +0800 Subject: [PATCH 01/15] rename tidb_ddl_version to tidb_enable_fast_create_table --- TOC.md | 2 +- basic-features.md | 2 +- ddl-v2.md => fast-create-table.md | 30 +++++++++++++++--------------- releases/release-7.6.0.md | 6 +++--- system-variables.md | 11 ++++++----- 5 files changed, 26 insertions(+), 25 deletions(-) rename ddl-v2.md => fast-create-table.md (53%) diff --git a/TOC.md b/TOC.md index f76d89486e3c6..94f2ca19e11f4 100644 --- a/TOC.md +++ b/TOC.md @@ -980,7 +980,7 @@ - [`SESSION_CONNECT_ATTRS`](/performance-schema/performance-schema-session-connect-attrs.md) - [`SYS`](/sys-schema.md) - [Metadata Lock](/metadata-lock.md) - - [TiDB DDL V2](/ddl-v2.md) + - [TiDB Accelerates Table Creation](/fast-create-table.md) - UI - TiDB Dashboard - [Overview](/dashboard/dashboard-intro.md) diff --git a/basic-features.md b/basic-features.md index ed54778107a00..bafda8ceb76f7 100644 --- a/basic-features.md +++ b/basic-features.md @@ -132,7 +132,7 @@ You can try out TiDB features on [TiDB Playground](https://play.tidbcloud.com/?u | [Metadata lock](/metadata-lock.md) | Y | Y | Y | Y | N | N | N | N | N | N | N | | [`FLASHBACK CLUSTER`](/sql-statements/sql-statement-flashback-cluster.md) | Y | Y | Y | Y | N | N | N | N | N | N | N | | [Pause](/sql-statements/sql-statement-admin-pause-ddl.md)/[Resume](/sql-statements/sql-statement-admin-resume-ddl.md) DDL | Y | Y | N | N | N | N | N | N | N | N | N | -| [TiDB DDL V2](/ddl-v2.md) | E | N | N | N | N | N | N | N | N | N | N | +| [TiDB Accelerates Table Creation](/fast-create-table.md) | N | N | N | N | N | N | N | N | N | N | N | ## Transactions diff --git a/ddl-v2.md b/fast-create-table.md similarity index 53% rename from ddl-v2.md rename to fast-create-table.md index 59db024d00c94..8f74b893df997 100644 --- a/ddl-v2.md +++ b/fast-create-table.md @@ -1,11 +1,11 @@ --- -title: Use TiDB DDL V2 to Accelerate Table Creation -summary: Learn the concept, principles, and implementation details of TiDB DDL V2 for acceleration table creation. +title: TiDB Accelerates Table Creation +summary: Learn the concept, principles, and implementation details of TiDB accelerates table creation. --- -# Use TiDB DDL V2 to Accelerate Table Creation +# TiDB Accelerates Table Creation -Starting from v7.6.0, the new version V2 of TiDB DDL supports creating tables quickly, which improves the efficiency of bulk table creation. +Starting from v8.0.0, TiDB supports creating tables quickly, which improves the efficiency of bulk table creation. TiDB uses the online asynchronous schema change algorithm to change the metadata. All DDL jobs are submitted to the `mysql.tidb_ddl_job` table, and the owner node pulls the DDL job to execute. After executing each phase of the online DDL algorithm, the DDL job is marked as completed and moved to the `mysql.tidb_ddl_history` table. Therefore, DDL statements can only be executed on the owner node and cannot be linearly extended. @@ -17,39 +17,39 @@ However, for some DDL statements, it is not necessary to strictly follow the onl ## Compatibility with TiDB tools -- [TiCDC](https://docs.pingcap.com/tidb/stable/ticdc-overview) does not support replicating the tables that are created by TiDB DDL V2. +- [TiCDC](https://docs.pingcap.com/tidb/stable/ticdc-overview) does not support replicating the tables that are created by TiDB accelerates table creation. ## Limitation -You can now use TiDB DDL V2 only in the [`CREATE TABLE`](/sql-statements/sql-statement-create-table.md) statement, and this statement must not include any foreign key constraints. +You can now use TiDB accelerates table creation only in the [`CREATE TABLE`](/sql-statements/sql-statement-create-table.md) statement, and this statement must not include any foreign key constraints. -## Use TiDB DDL V2 +## Use TiDB Accelerates Table Creation -You can enable or disable TiDB DDL V2 by specifying the value of the system variable [`tidb_ddl_version`](/system-variables.md#tidb_ddl_version-new-in-v760) . +You can enable or disable TiDB accelerates table creation by specifying the value of the system variable [`tidb_fast_create_table`](/system-variables.md#tidb_fast_create_table-new-in-v800) . -To enable TiDB DDL V2, set the value of this variable to `2`: +To enable TiDB accelerates table creation, set the value of this variable to `ON`: ```sql -SET GLOBAL tidb_ddl_version = 2; +SET GLOBAL tidb_fast_create_table = ON; ``` -To disable TiDB DDL V2, set the value of this variable to `1`: +To disable TiDB accelerates table creation, set the value of this variable to `OFF`: ```sql -SET GLOBAL tidb_ddl_version = 1; +SET GLOBAL tidb_fast_create_table = OFF; ``` ## Implementation principle -The detailed implementation principle of TiDB DDL V2 for accelerating table creation is as follows: +The detailed implementation principle of TiDB accelerates table creation is as follows: 1. Create a `CREATE TABLE` Job. - This step is the same as that of the V1 implementation. The corresponding DDL Job is generated by parsing the `CREATE TABLE` statement. + The corresponding DDL Job is generated by parsing the `CREATE TABLE` statement. 2. Execute the `CREATE TABLE` job. - Different from V1, in TiDB DDL V2, the TiDB node that receives the `CREATE TABLE` statement executes it directly, and then persists the table structure to TiKV. At the same time, the `CREATE TABLE` job is marked as completed and inserted into the `mysql.tidb_ddl_history` table. + The TiDB node that receives the `CREATE TABLE` statement executes it directly, and then persists the table structure to TiKV. At the same time, the `CREATE TABLE` job is marked as completed and inserted into the `mysql.tidb_ddl_history` table. 3. Synchronize the table information. diff --git a/releases/release-7.6.0.md b/releases/release-7.6.0.md index 0cac1432d7e3f..47bfbdd58ae6b 100644 --- a/releases/release-7.6.0.md +++ b/releases/release-7.6.0.md @@ -111,9 +111,9 @@ Quick access: [Quick start](https://docs.pingcap.com/tidb/v7.6/quick-start-with- * Improve the performance of creating tables by 10 times (experimental) [#49752](https://github.com/pingcap/tidb/issues/49752) @[gmhdbjd](https://github.com/gmhdbjd) - In previous versions, when migrating tens of thousands of tables from the upstream database to TiDB, it is time-consuming and inefficient for TiDB to create these tables. Starting from v7.6.0, TiDB introduces a new TiDB DDL V2 architecture. You can enable it by configuring the system variable [`tidb_ddl_version`](/system-variables.md#tidb_ddl_version-new-in-v760). Compared with previous versions, the new version of the DDL improves the performance of creating batch tables by 10 times, and significantly reduces time for creating tables. + In previous versions, when migrating tens of thousands of tables from the upstream database to TiDB, it is time-consuming and inefficient for TiDB to create these tables. Starting from v7.6.0, TiDB introduces a new TiDB DDL V2 architecture. You can enable it by configuring the system variable [`tidb_ddl_version`](https://docs.pingcap.com/tidb/v7.6/system-variables#tidb_ddl_version-new-in-v760). Compared with previous versions, the new version of the DDL improves the performance of creating batch tables by 10 times, and significantly reduces time for creating tables. - For more information, see [documentation](/ddl-v2.md). + For more information, see [documentation](https://docs.pingcap.com/tidb/v7.6/ddl-v2). * Support periodic full compaction (experimental) [#12729](https://github.com/tikv/tikv/issues/12729) [afeinberg](https://github.com/afeinberg) @@ -269,7 +269,7 @@ Quick access: [Quick start](https://docs.pingcap.com/tidb/v7.6/quick-start-with- | [`tidb_auto_analyze_partition_batch_size`](/system-variables.md#tidb_auto_analyze_partition_batch_size-new-in-v640) | Modified | Changes the default value from `1` to `128` after further tests. | | [`tidb_sysproc_scan_concurrency`](/system-variables.md#tidb_sysproc_scan_concurrency-new-in-v650) | Modified | In a large-scale cluster, the concurrency of `scan` operations can be adjusted higher to meet the needs of `ANALYZE`. Therefore, change the maximum value from `256` to `4294967295`. | | [`tidb_analyze_distsql_scan_concurrency`](/system-variables.md#tidb_analyze_distsql_scan_concurrency-new-in-v760) | Newly added | Sets the concurrency of the `scan` operation when executing the `ANALYZE` operation. The default value is `4`. | -| [`tidb_ddl_version`](/system-variables.md#tidb_ddl_version-new-in-v760) | Newly added | Controls whether to enable [TiDB DDL V2](/ddl-v2.md). Set the value to `2` to enable it and `1` to disable it. The default value is `1`. When TiDB DDL V2 is enabled, DDL statements will be executed using TiDB DDL V2. The execution speed of DDL statements for creating tables is increased by 10 times compared with TiDB DDL V1. | +| [`tidb_ddl_version`](https://docs.pingcap.com/tidb/v7.6/system-variables#tidb_ddl_version-new-in-v76) | Newly added | Controls whether to enable [TiDB DDL V2](https://docs.pingcap.com/tidb/v7.6/ddl-v2). Set the value to `2` to enable it and `1` to disable it. The default value is `1`. When TiDB DDL V2 is enabled, DDL statements will be executed using TiDB DDL V2. The execution speed of DDL statements for creating tables is increased by 10 times compared with TiDB DDL V1. | | [`tidb_enable_global_index`](/system-variables.md#tidb_enable_global_index-new-in-v760) | Newly added | Controls whether to support creating `Global indexes` for partitioned tables. The default value is `OFF`. `Global index` is currently in the development stage. **It is not recommended to modify the value of this system variable**. | | [`tidb_idle_transaction_timeout`](/system-variables.md#tidb_idle_transaction_timeout-new-in-v760) | Newly added | Controls the idle timeout for transactions in a user session. When a user session is in a transactional state and remains idle for a duration exceeding the value of this variable, TiDB will terminate the session. The default value `0` means unlimited. | | [`tidb_opt_enable_fuzzy_binding`](/system-variables.md#tidb_opt_enable_fuzzy_binding-new-in-v760) | Newly added | Controls whether to enable the cross-database binding feature. The default value `OFF` means cross-database binding is disabled. | diff --git a/system-variables.md b/system-variables.md index 24d464d7d2bed..4c89c4d300c64 100644 --- a/system-variables.md +++ b/system-variables.md @@ -1712,7 +1712,7 @@ mysql> SELECT job_info FROM mysql.analyze_jobs ORDER BY end_time DESC LIMIT 1; - Unit: Threads - This variable is used to set the concurrency of the DDL operation in the `re-organize` phase. -### `tidb_ddl_version` New in v7.6.0 +### `tidb_fast_create_table` New in v8.0.0 > **Warning:** > @@ -1721,10 +1721,11 @@ mysql> SELECT job_info FROM mysql.analyze_jobs ORDER BY end_time DESC LIMIT 1; - Scope: GLOBAL - Persists to cluster: Yes - Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): No -- Default value: `1` -- Value range: `1` or `2` -- This variable is used to control whether to enable [TiDB DDL V2](/ddl-v2.md). Setting it to `2` enables this feature, and setting it to `1` disables it. The default value is `1`. After you enable it, TiDB uses TiDB DDL V2 to execute DDL statements. -- Starting from v7.6.0, TiDB only supports accelerating table creation by the [`CREATE TABLE`](/sql-statements/sql-statement-create-table.md) statement. +- Type: Boolean +- Default value: `OFF` +- This variable is used to control whether to enable [TiDB Accerates Table Creation](/fast-create-table.md). +- Starting from v8.0.0, TiDB supports accelerating table creation by the [`CREATE TABLE`](/sql-statements/sql-statement-create-table.md) statement. +- This feature is controlled in v7.6.0 by [`tidb_ddl_version`](https://docs.pingcap.com/tidb/v7.6/system-variables#tidb_ddl_version-new-in-v760). ### tidb_default_string_match_selectivity New in v6.2.0 From f51ce34ba671d368154746a746b28c79626d47ad Mon Sep 17 00:00:00 2001 From: gmhdbjd Date: Wed, 20 Mar 2024 21:13:38 +0800 Subject: [PATCH 02/15] fix ci --- TOC-tidb-cloud.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TOC-tidb-cloud.md b/TOC-tidb-cloud.md index 5c46152b16969..a52197e15f6de 100644 --- a/TOC-tidb-cloud.md +++ b/TOC-tidb-cloud.md @@ -603,7 +603,7 @@ - [`SESSION_CONNECT_ATTRS`](/performance-schema/performance-schema-session-connect-attrs.md) - [Metadata Lock](/metadata-lock.md) - [Use UUIDs](/best-practices/uuid.md) - - [TiDB DDL V2](/ddl-v2.md) + - [TiDB Create Table Acceration](/fast-create-table.md) - [System Variables](/system-variables.md) - [Server Status Variables](/status-variables.md) - Storage Engines From cf1ad0b56782e77af20f463100043b2607231295 Mon Sep 17 00:00:00 2001 From: gmhdbjd Date: Thu, 21 Mar 2024 14:16:24 +0800 Subject: [PATCH 03/15] update --- fast-create-table.md | 6 +++--- system-variables.md | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fast-create-table.md b/fast-create-table.md index 8f74b893df997..4a3975976910c 100644 --- a/fast-create-table.md +++ b/fast-create-table.md @@ -25,18 +25,18 @@ You can now use TiDB accelerates table creation only in the [`CREATE TABLE`](/sq ## Use TiDB Accelerates Table Creation -You can enable or disable TiDB accelerates table creation by specifying the value of the system variable [`tidb_fast_create_table`](/system-variables.md#tidb_fast_create_table-new-in-v800) . +You can enable or disable TiDB accelerates table creation by specifying the value of the system variable [`table_enable_fast_create_table`](/system-variables.md#table_enable_fast_create_table-new-in-v800) . To enable TiDB accelerates table creation, set the value of this variable to `ON`: ```sql -SET GLOBAL tidb_fast_create_table = ON; +SET GLOBAL table_enable_fast_create_table = ON; ``` To disable TiDB accelerates table creation, set the value of this variable to `OFF`: ```sql -SET GLOBAL tidb_fast_create_table = OFF; +SET GLOBAL table_enable_fast_create_table = OFF; ``` ## Implementation principle diff --git a/system-variables.md b/system-variables.md index 4c89c4d300c64..f98a82470e056 100644 --- a/system-variables.md +++ b/system-variables.md @@ -1712,7 +1712,7 @@ mysql> SELECT job_info FROM mysql.analyze_jobs ORDER BY end_time DESC LIMIT 1; - Unit: Threads - This variable is used to set the concurrency of the DDL operation in the `re-organize` phase. -### `tidb_fast_create_table` New in v8.0.0 +### `table_enable_fast_create_table` New in v8.0.0 > **Warning:** > From f800731f3b96136ec92f9378dd224800b1593838 Mon Sep 17 00:00:00 2001 From: xixirangrang Date: Thu, 21 Mar 2024 14:17:28 +0800 Subject: [PATCH 04/15] Update system-variables.md --- system-variables.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system-variables.md b/system-variables.md index f98a82470e056..f60e66bcc0fbc 100644 --- a/system-variables.md +++ b/system-variables.md @@ -1725,7 +1725,7 @@ mysql> SELECT job_info FROM mysql.analyze_jobs ORDER BY end_time DESC LIMIT 1; - Default value: `OFF` - This variable is used to control whether to enable [TiDB Accerates Table Creation](/fast-create-table.md). - Starting from v8.0.0, TiDB supports accelerating table creation by the [`CREATE TABLE`](/sql-statements/sql-statement-create-table.md) statement. -- This feature is controlled in v7.6.0 by [`tidb_ddl_version`](https://docs.pingcap.com/tidb/v7.6/system-variables#tidb_ddl_version-new-in-v760). +- In v7.6.0, this feature is controlled by [`tidb_ddl_version`](https://docs.pingcap.com/tidb/v7.6/system-variables#tidb_ddl_version-new-in-v760). ### tidb_default_string_match_selectivity New in v6.2.0 From 3322845951654b87a5909c0a5e88e49642d074ff Mon Sep 17 00:00:00 2001 From: xixirangrang Date: Fri, 22 Mar 2024 16:10:35 +0800 Subject: [PATCH 05/15] Update TOC-tidb-cloud.md --- TOC-tidb-cloud.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TOC-tidb-cloud.md b/TOC-tidb-cloud.md index a52197e15f6de..f8591c04631d5 100644 --- a/TOC-tidb-cloud.md +++ b/TOC-tidb-cloud.md @@ -603,7 +603,7 @@ - [`SESSION_CONNECT_ATTRS`](/performance-schema/performance-schema-session-connect-attrs.md) - [Metadata Lock](/metadata-lock.md) - [Use UUIDs](/best-practices/uuid.md) - - [TiDB Create Table Acceration](/fast-create-table.md) + - [TiDB Accerates Table Creation](/fast-create-table.md) - [System Variables](/system-variables.md) - [Server Status Variables](/status-variables.md) - Storage Engines From 6543932b308bf676a8c292c255aaa9a58929c1c7 Mon Sep 17 00:00:00 2001 From: xixirangrang <35301108+hfxsd@users.noreply.github.com> Date: Fri, 22 Mar 2024 16:20:47 +0800 Subject: [PATCH 06/15] Update fast-create-table.md --- fast-create-table.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/fast-create-table.md b/fast-create-table.md index 4a3975976910c..a9490aa969905 100644 --- a/fast-create-table.md +++ b/fast-create-table.md @@ -1,11 +1,11 @@ --- title: TiDB Accelerates Table Creation -summary: Learn the concept, principles, and implementation details of TiDB accelerates table creation. +summary: Learn the concept, principles, and implementation details of performance optimization for creating tables. --- # TiDB Accelerates Table Creation -Starting from v8.0.0, TiDB supports creating tables quickly, which improves the efficiency of bulk table creation. +TiDB v7.6.0 introduces the system variable [`tidb_ddl_version`](https://docs.pingcap.com/tidb/v7.6/system-variables#tidb_enable_fast_create_table-new-in-v800) 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`](/system-variables.md#tidb_enable_fast_create_table-new-in-v800). TiDB uses the online asynchronous schema change algorithm to change the metadata. All DDL jobs are submitted to the `mysql.tidb_ddl_job` table, and the owner node pulls the DDL job to execute. After executing each phase of the online DDL algorithm, the DDL job is marked as completed and moved to the `mysql.tidb_ddl_history` table. Therefore, DDL statements can only be executed on the owner node and cannot be linearly extended. @@ -17,23 +17,23 @@ However, for some DDL statements, it is not necessary to strictly follow the onl ## Compatibility with TiDB tools -- [TiCDC](https://docs.pingcap.com/tidb/stable/ticdc-overview) does not support replicating the tables that are created by TiDB accelerates table creation. +- [TiCDC](https://docs.pingcap.com/tidb/stable/ticdc-overview) does not support replicating the tables that are created by `table_enable_fast_create_table`. ## Limitation -You can now use TiDB accelerates table creation only in the [`CREATE TABLE`](/sql-statements/sql-statement-create-table.md) statement, and this statement must not include any foreign key constraints. +You can now use performance optimization for table creation only in the [`CREATE TABLE`](/sql-statements/sql-statement-create-table.md) statement, and this statement must not include any foreign key constraints. -## Use TiDB Accelerates Table Creation +## Use `table_enable_fast_create_table` to accelerate table creation -You can enable or disable TiDB accelerates table creation by specifying the value of the system variable [`table_enable_fast_create_table`](/system-variables.md#table_enable_fast_create_table-new-in-v800) . +You can enable or disable performance optimization for creating tables by specifying the value of the system variable [`table_enable_fast_create_table`](/system-variables.md#table_enable_fast_create_table-new-in-v800). -To enable TiDB accelerates table creation, set the value of this variable to `ON`: +To enable performance optimization for creating tables, set the value of this variable to `ON`: ```sql SET GLOBAL table_enable_fast_create_table = ON; ``` -To disable TiDB accelerates table creation, set the value of this variable to `OFF`: +To disable performance optimization for creating tables, set the value of this variable to `OFF`: ```sql SET GLOBAL table_enable_fast_create_table = OFF; @@ -41,7 +41,7 @@ SET GLOBAL table_enable_fast_create_table = OFF; ## Implementation principle -The detailed implementation principle of TiDB accelerates table creation is as follows: +The detailed implementation principle of performance optimization for table creation is as follows: 1. Create a `CREATE TABLE` Job. From cb61643b6566ca0e5ef33de93f41fa2b995bf6b9 Mon Sep 17 00:00:00 2001 From: xixirangrang Date: Fri, 22 Mar 2024 16:25:21 +0800 Subject: [PATCH 07/15] Apply suggestions from code review --- releases/release-7.6.0.md | 2 +- system-variables.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/releases/release-7.6.0.md b/releases/release-7.6.0.md index 47bfbdd58ae6b..b5bee4048eb99 100644 --- a/releases/release-7.6.0.md +++ b/releases/release-7.6.0.md @@ -269,7 +269,7 @@ Quick access: [Quick start](https://docs.pingcap.com/tidb/v7.6/quick-start-with- | [`tidb_auto_analyze_partition_batch_size`](/system-variables.md#tidb_auto_analyze_partition_batch_size-new-in-v640) | Modified | Changes the default value from `1` to `128` after further tests. | | [`tidb_sysproc_scan_concurrency`](/system-variables.md#tidb_sysproc_scan_concurrency-new-in-v650) | Modified | In a large-scale cluster, the concurrency of `scan` operations can be adjusted higher to meet the needs of `ANALYZE`. Therefore, change the maximum value from `256` to `4294967295`. | | [`tidb_analyze_distsql_scan_concurrency`](/system-variables.md#tidb_analyze_distsql_scan_concurrency-new-in-v760) | Newly added | Sets the concurrency of the `scan` operation when executing the `ANALYZE` operation. The default value is `4`. | -| [`tidb_ddl_version`](https://docs.pingcap.com/tidb/v7.6/system-variables#tidb_ddl_version-new-in-v76) | Newly added | Controls whether to enable [TiDB DDL V2](https://docs.pingcap.com/tidb/v7.6/ddl-v2). Set the value to `2` to enable it and `1` to disable it. The default value is `1`. When TiDB DDL V2 is enabled, DDL statements will be executed using TiDB DDL V2. The execution speed of DDL statements for creating tables is increased by 10 times compared with TiDB DDL V1. | +| [`tidb_ddl_version`](https://docs.pingcap.com/tidb/v7.6/system-variables#tidb_ddl_version-new-in-v760) | Newly added | Controls whether to enable [TiDB DDL V2](https://docs.pingcap.com/tidb/v7.6/ddl-v2). Set the value to `2` to enable it and `1` to disable it. The default value is `1`. When TiDB DDL V2 is enabled, DDL statements will be executed using TiDB DDL V2. The execution speed of DDL statements for creating tables is increased by 10 times compared with TiDB DDL V1. | | [`tidb_enable_global_index`](/system-variables.md#tidb_enable_global_index-new-in-v760) | Newly added | Controls whether to support creating `Global indexes` for partitioned tables. The default value is `OFF`. `Global index` is currently in the development stage. **It is not recommended to modify the value of this system variable**. | | [`tidb_idle_transaction_timeout`](/system-variables.md#tidb_idle_transaction_timeout-new-in-v760) | Newly added | Controls the idle timeout for transactions in a user session. When a user session is in a transactional state and remains idle for a duration exceeding the value of this variable, TiDB will terminate the session. The default value `0` means unlimited. | | [`tidb_opt_enable_fuzzy_binding`](/system-variables.md#tidb_opt_enable_fuzzy_binding-new-in-v760) | Newly added | Controls whether to enable the cross-database binding feature. The default value `OFF` means cross-database binding is disabled. | diff --git a/system-variables.md b/system-variables.md index f60e66bcc0fbc..d2fb616884880 100644 --- a/system-variables.md +++ b/system-variables.md @@ -1725,7 +1725,7 @@ mysql> SELECT job_info FROM mysql.analyze_jobs ORDER BY end_time DESC LIMIT 1; - Default value: `OFF` - This variable is used to control whether to enable [TiDB Accerates Table Creation](/fast-create-table.md). - Starting from v8.0.0, TiDB supports accelerating table creation by the [`CREATE TABLE`](/sql-statements/sql-statement-create-table.md) statement. -- In v7.6.0, this feature is controlled by [`tidb_ddl_version`](https://docs.pingcap.com/tidb/v7.6/system-variables#tidb_ddl_version-new-in-v760). +- This variable is renamed from the variable [`tidb_ddl_version`](https://docs.pingcap.com/tidb/v7.6/system-variables#tidb_ddl_version-new-in-v760) that is introduced in v7.6.0. ### tidb_default_string_match_selectivity New in v6.2.0 From 566c557b8a24c3cdbf29874ced885f85531cba03 Mon Sep 17 00:00:00 2001 From: GMHDBJD <35025882+GMHDBJD@users.noreply.github.com> Date: Fri, 22 Mar 2024 16:59:37 +0800 Subject: [PATCH 08/15] Update system-variables.md Co-authored-by: xixirangrang --- system-variables.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system-variables.md b/system-variables.md index d2fb616884880..4fe8b4462c3ab 100644 --- a/system-variables.md +++ b/system-variables.md @@ -1712,7 +1712,7 @@ mysql> SELECT job_info FROM mysql.analyze_jobs ORDER BY end_time DESC LIMIT 1; - Unit: Threads - This variable is used to set the concurrency of the DDL operation in the `re-organize` phase. -### `table_enable_fast_create_table` New in v8.0.0 +### `tidb_enable_fast_create_table` New in v8.0.0 > **Warning:** > From c7358c3fd45649f36c717d1884094c51c36d5472 Mon Sep 17 00:00:00 2001 From: GMHDBJD <35025882+GMHDBJD@users.noreply.github.com> Date: Fri, 22 Mar 2024 16:59:53 +0800 Subject: [PATCH 09/15] Update fast-create-table.md Co-authored-by: xixirangrang --- fast-create-table.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fast-create-table.md b/fast-create-table.md index a9490aa969905..2b388acfe0575 100644 --- a/fast-create-table.md +++ b/fast-create-table.md @@ -17,7 +17,7 @@ However, for some DDL statements, it is not necessary to strictly follow the onl ## Compatibility with TiDB tools -- [TiCDC](https://docs.pingcap.com/tidb/stable/ticdc-overview) does not support replicating the tables that are created by `table_enable_fast_create_table`. +- [TiCDC](https://docs.pingcap.com/tidb/stable/ticdc-overview) does not support replicating the tables that are created by `tidb_enable_fast_create_table`. ## Limitation From 0a6c579395891a2024ae46377942bc94e7e2c4cc Mon Sep 17 00:00:00 2001 From: GMHDBJD <35025882+GMHDBJD@users.noreply.github.com> Date: Fri, 22 Mar 2024 17:00:06 +0800 Subject: [PATCH 10/15] Update fast-create-table.md Co-authored-by: xixirangrang --- fast-create-table.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fast-create-table.md b/fast-create-table.md index 2b388acfe0575..7bd04702d0ada 100644 --- a/fast-create-table.md +++ b/fast-create-table.md @@ -23,7 +23,7 @@ However, for some DDL statements, it is not necessary to strictly follow the onl You can now use performance optimization for table creation only in the [`CREATE TABLE`](/sql-statements/sql-statement-create-table.md) statement, and this statement must not include any foreign key constraints. -## Use `table_enable_fast_create_table` to accelerate table creation +## 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 [`table_enable_fast_create_table`](/system-variables.md#table_enable_fast_create_table-new-in-v800). From cb6bec24bbdb2e15d2bd239091cdbe2b707c78ca Mon Sep 17 00:00:00 2001 From: xixirangrang Date: Fri, 22 Mar 2024 17:01:06 +0800 Subject: [PATCH 11/15] Apply suggestions from code review --- fast-create-table.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fast-create-table.md b/fast-create-table.md index 7bd04702d0ada..b0130369fa9be 100644 --- a/fast-create-table.md +++ b/fast-create-table.md @@ -25,18 +25,18 @@ You can now use performance optimization for table creation only in the [`CREATE ## 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 [`table_enable_fast_create_table`](/system-variables.md#table_enable_fast_create_table-new-in-v800). +You can enable or disable performance optimization for creating tables by specifying the value of the system variable [`tidb_enable_fast_create_table`](/system-variables.md#tidb_enable_fast_create_table-new-in-v800). To enable performance optimization for creating tables, set the value of this variable to `ON`: ```sql -SET GLOBAL table_enable_fast_create_table = ON; +SET GLOBAL tidb_enable_fast_create_table = ON; ``` To disable performance optimization for creating tables, set the value of this variable to `OFF`: ```sql -SET GLOBAL table_enable_fast_create_table = OFF; +SET GLOBAL tidb_enable_fast_create_table = OFF; ``` ## Implementation principle From 242c8c46044efc17935ccff8a6f2fe1531ad3a02 Mon Sep 17 00:00:00 2001 From: xixirangrang Date: Mon, 25 Mar 2024 09:54:50 +0800 Subject: [PATCH 12/15] Update system-variables.md Co-authored-by: Frank945946 <108602632+Frank945946@users.noreply.github.com> --- system-variables.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system-variables.md b/system-variables.md index 4fe8b4462c3ab..e769051da7a63 100644 --- a/system-variables.md +++ b/system-variables.md @@ -1725,7 +1725,7 @@ mysql> SELECT job_info FROM mysql.analyze_jobs ORDER BY end_time DESC LIMIT 1; - Default value: `OFF` - This variable is used to control whether to enable [TiDB Accerates Table Creation](/fast-create-table.md). - Starting from v8.0.0, TiDB supports accelerating table creation by the [`CREATE TABLE`](/sql-statements/sql-statement-create-table.md) statement. -- This variable is renamed from the variable [`tidb_ddl_version`](https://docs.pingcap.com/tidb/v7.6/system-variables#tidb_ddl_version-new-in-v760) that is introduced in v7.6.0. +- This variable is renamed from the variable [`tidb_ddl_version`](https://docs.pingcap.com/tidb/v7.6/system-variables#tidb_ddl_version-new-in-v760) that is introduced in v7.6.0. Starting from v8.0.0, [`tidb_ddl_version`](https://docs.pingcap.com/tidb/v7.6/system-variables#tidb_ddl_version-new-in-v760) no longer takes effect. ### tidb_default_string_match_selectivity New in v6.2.0 From 4818cac3421364bc3195b816c556de26ae3dbc3a Mon Sep 17 00:00:00 2001 From: xixirangrang Date: Mon, 25 Mar 2024 15:23:50 +0800 Subject: [PATCH 13/15] Apply suggestions from code review Co-authored-by: Aolin --- TOC-tidb-cloud.md | 2 +- TOC.md | 2 +- basic-features.md | 2 +- fast-create-table.md | 7 ++++--- system-variables.md | 6 +++--- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/TOC-tidb-cloud.md b/TOC-tidb-cloud.md index f8591c04631d5..0b2cf6cba7cb1 100644 --- a/TOC-tidb-cloud.md +++ b/TOC-tidb-cloud.md @@ -603,7 +603,7 @@ - [`SESSION_CONNECT_ATTRS`](/performance-schema/performance-schema-session-connect-attrs.md) - [Metadata Lock](/metadata-lock.md) - [Use UUIDs](/best-practices/uuid.md) - - [TiDB Accerates Table Creation](/fast-create-table.md) + - [TiDB Accelerated Table Creation](/fast-create-table.md) - [System Variables](/system-variables.md) - [Server Status Variables](/status-variables.md) - Storage Engines diff --git a/TOC.md b/TOC.md index 94f2ca19e11f4..bd807e635c801 100644 --- a/TOC.md +++ b/TOC.md @@ -980,7 +980,7 @@ - [`SESSION_CONNECT_ATTRS`](/performance-schema/performance-schema-session-connect-attrs.md) - [`SYS`](/sys-schema.md) - [Metadata Lock](/metadata-lock.md) - - [TiDB Accelerates Table Creation](/fast-create-table.md) + - [TiDB Accelerated Table Creation](/fast-create-table.md) - UI - TiDB Dashboard - [Overview](/dashboard/dashboard-intro.md) diff --git a/basic-features.md b/basic-features.md index bafda8ceb76f7..8fe3936b7bd02 100644 --- a/basic-features.md +++ b/basic-features.md @@ -132,7 +132,7 @@ You can try out TiDB features on [TiDB Playground](https://play.tidbcloud.com/?u | [Metadata lock](/metadata-lock.md) | Y | Y | Y | Y | N | N | N | N | N | N | N | | [`FLASHBACK CLUSTER`](/sql-statements/sql-statement-flashback-cluster.md) | Y | Y | Y | Y | N | N | N | N | N | N | N | | [Pause](/sql-statements/sql-statement-admin-pause-ddl.md)/[Resume](/sql-statements/sql-statement-admin-resume-ddl.md) DDL | Y | Y | N | N | N | N | N | N | N | N | N | -| [TiDB Accelerates Table Creation](/fast-create-table.md) | N | N | N | N | N | N | N | N | N | N | N | +| [TiDB Accelerated Table Creation](/fast-create-table.md) | N | N | N | N | N | N | N | N | N | N | N | ## Transactions diff --git a/fast-create-table.md b/fast-create-table.md index b0130369fa9be..f97eec9d5cfd0 100644 --- a/fast-create-table.md +++ b/fast-create-table.md @@ -1,9 +1,10 @@ --- -title: TiDB Accelerates Table Creation -summary: Learn the concept, principles, and implementation details of performance optimization for creating tables. +title: TiDB Accelerated Table Creation +summary: Learn the concept, principles, and implementation details of performance optimization for creating tables in TiDB. +aliases: ['/tidb/dev/ddl-v2/'] --- -# TiDB Accelerates Table Creation +# TiDB Accelerated Table Creation TiDB v7.6.0 introduces the system variable [`tidb_ddl_version`](https://docs.pingcap.com/tidb/v7.6/system-variables#tidb_enable_fast_create_table-new-in-v800) 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`](/system-variables.md#tidb_enable_fast_create_table-new-in-v800). diff --git a/system-variables.md b/system-variables.md index e769051da7a63..e3be777360052 100644 --- a/system-variables.md +++ b/system-variables.md @@ -1723,9 +1723,9 @@ mysql> SELECT job_info FROM mysql.analyze_jobs ORDER BY end_time DESC LIMIT 1; - Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): No - Type: Boolean - Default value: `OFF` -- This variable is used to control whether to enable [TiDB Accerates Table Creation](/fast-create-table.md). -- Starting from v8.0.0, TiDB supports accelerating table creation by the [`CREATE TABLE`](/sql-statements/sql-statement-create-table.md) statement. -- This variable is renamed from the variable [`tidb_ddl_version`](https://docs.pingcap.com/tidb/v7.6/system-variables#tidb_ddl_version-new-in-v760) that is introduced in v7.6.0. Starting from v8.0.0, [`tidb_ddl_version`](https://docs.pingcap.com/tidb/v7.6/system-variables#tidb_ddl_version-new-in-v760) no longer takes effect. +- This variable is used to control whether to enable [TiDB Accelerated Table Creation](/fast-create-table.md). +- Starting from v8.0.0, TiDB supports accelerating table creation by the [`CREATE TABLE`](/sql-statements/sql-statement-create-table.md) statement using `tidb_enable_fast_create_table`. +- This variable is renamed from the variable [`tidb_ddl_version`](https://docs.pingcap.com/tidb/v7.6/system-variables#tidb_ddl_version-new-in-v760) that is introduced in v7.6.0. Starting from v8.0.0, `tidb_ddl_version` no longer takes effect. ### tidb_default_string_match_selectivity New in v6.2.0 From c47995ef2447f425de9fe9439e288512f2526945 Mon Sep 17 00:00:00 2001 From: xixirangrang <35301108+hfxsd@users.noreply.github.com> Date: Mon, 25 Mar 2024 17:02:57 +0800 Subject: [PATCH 14/15] renamed --- fast-create-table.md => accelerated-table-creation.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename fast-create-table.md => accelerated-table-creation.md (100%) diff --git a/fast-create-table.md b/accelerated-table-creation.md similarity index 100% rename from fast-create-table.md rename to accelerated-table-creation.md From 0bcc28f977c101501486524de5ce9a99cd2f5866 Mon Sep 17 00:00:00 2001 From: xixirangrang Date: Mon, 25 Mar 2024 17:05:01 +0800 Subject: [PATCH 15/15] Apply suggestions from code review --- TOC-tidb-cloud.md | 2 +- TOC.md | 2 +- basic-features.md | 2 +- system-variables.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/TOC-tidb-cloud.md b/TOC-tidb-cloud.md index 0b2cf6cba7cb1..b50aae1a4cdce 100644 --- a/TOC-tidb-cloud.md +++ b/TOC-tidb-cloud.md @@ -603,7 +603,7 @@ - [`SESSION_CONNECT_ATTRS`](/performance-schema/performance-schema-session-connect-attrs.md) - [Metadata Lock](/metadata-lock.md) - [Use UUIDs](/best-practices/uuid.md) - - [TiDB Accelerated Table Creation](/fast-create-table.md) + - [TiDB Accelerated Table Creation](/accelerated-table-creation.md) - [System Variables](/system-variables.md) - [Server Status Variables](/status-variables.md) - Storage Engines diff --git a/TOC.md b/TOC.md index bd807e635c801..bea0bfa4ad475 100644 --- a/TOC.md +++ b/TOC.md @@ -980,7 +980,7 @@ - [`SESSION_CONNECT_ATTRS`](/performance-schema/performance-schema-session-connect-attrs.md) - [`SYS`](/sys-schema.md) - [Metadata Lock](/metadata-lock.md) - - [TiDB Accelerated Table Creation](/fast-create-table.md) + - [TiDB Accelerated Table Creation](/accelerated-table-creation.md) - UI - TiDB Dashboard - [Overview](/dashboard/dashboard-intro.md) diff --git a/basic-features.md b/basic-features.md index 8fe3936b7bd02..0821d194c9a63 100644 --- a/basic-features.md +++ b/basic-features.md @@ -132,7 +132,7 @@ You can try out TiDB features on [TiDB Playground](https://play.tidbcloud.com/?u | [Metadata lock](/metadata-lock.md) | Y | Y | Y | Y | N | N | N | N | N | N | N | | [`FLASHBACK CLUSTER`](/sql-statements/sql-statement-flashback-cluster.md) | Y | Y | Y | Y | N | N | N | N | N | N | N | | [Pause](/sql-statements/sql-statement-admin-pause-ddl.md)/[Resume](/sql-statements/sql-statement-admin-resume-ddl.md) DDL | Y | Y | N | N | N | N | N | N | N | N | N | -| [TiDB Accelerated Table Creation](/fast-create-table.md) | N | N | N | N | N | N | N | N | N | N | N | +| [TiDB Accelerated Table Creation](/accelerated-table-creation.md) | N | N | N | N | N | N | N | N | N | N | N | ## Transactions diff --git a/system-variables.md b/system-variables.md index e3be777360052..1be25dc862889 100644 --- a/system-variables.md +++ b/system-variables.md @@ -1723,7 +1723,7 @@ mysql> SELECT job_info FROM mysql.analyze_jobs ORDER BY end_time DESC LIMIT 1; - Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): No - Type: Boolean - Default value: `OFF` -- This variable is used to control whether to enable [TiDB Accelerated Table Creation](/fast-create-table.md). +- This variable is used to control whether to enable [TiDB Accelerated Table Creation](/accelerated-table-creation.md). - Starting from v8.0.0, TiDB supports accelerating table creation by the [`CREATE TABLE`](/sql-statements/sql-statement-create-table.md) statement using `tidb_enable_fast_create_table`. - This variable is renamed from the variable [`tidb_ddl_version`](https://docs.pingcap.com/tidb/v7.6/system-variables#tidb_ddl_version-new-in-v760) that is introduced in v7.6.0. Starting from v8.0.0, `tidb_ddl_version` no longer takes effect.