Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable fast create table on default #19032

Merged
merged 5 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions accelerated-table-creation.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,9 @@ TiDB v7.6.0 引入了系统变量 [`tidb_ddl_version`](https://docs.pingcap.com/

合并后的批量建表语句在同一个事务内执行,如果其中一个语句失败,所有语句都会失败。

> **警告:**
>
> TiDB 加速建表目前为实验特性,不建议在生产环境中使用。该功能可能会在未事先通知的情况下发生变化或删除。如果发现 bug,请在 GitHub 上提 [issue](https://github.com/pingcap/tidb/issues) 反馈。

## 与 TiDB 工具的兼容性

- [TiCDC](/ticdc/ticdc-overview.md) 暂不支持同步通过 TiDB 加速创建的表。
- TiDB v8.3.0 版本之前 [TiCDC](/ticdc/ticdc-overview.md) 暂不支持同步通过 TiDB 加速创建的表。TiDB v8.3.0 版本之后可以正常同步
Oreoxmt marked this conversation as resolved.
Show resolved Hide resolved

## 限制

Expand All @@ -28,6 +24,8 @@ TiDB 加速建表目前仅适用于 [`CREATE TABLE`](/sql-statements/sql-stateme

你可以通过设置系统变量 [`tidb_enable_fast_create_table`](/system-variables.md#tidb_enable_fast_create_table-从-v800-版本开始引入) 的值来开启或关闭加速建表的功能。

从 TiDB v8.5.0 版本开始,新建集群 `tidb_enable_fast_create_table` 默认开启,如果是从老版本升级上来,`tidb_enable_fast_create_table` 维持原值。
D3Hunter marked this conversation as resolved.
Show resolved Hide resolved

要开启该功能,将该变量的值设置为 `ON`:

```sql
Expand Down
7 changes: 2 additions & 5 deletions system-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -1530,18 +1530,15 @@ mysql> SELECT job_info FROM mysql.analyze_jobs ORDER BY end_time DESC LIMIT 1;

### `tidb_enable_fast_create_table` <span class="version-mark">从 v8.0.0 版本开始引入</span>

> **警告:**
>
> 该变量目前为实验特性,不建议在生产环境中使用。该功能可能会在未事先通知的情况下发生变化或删除。如果发现 bug,请在 GitHub 上提 [issue](https://github.com/pingcap/tidb/issues) 反馈。

- 作用域:GLOBAL
- 是否持久化到集群:是
- 是否受 Hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value) 控制:否
- 类型:布尔型
- 默认值:`OFF`
- 默认值:`ON`
D3Hunter marked this conversation as resolved.
Show resolved Hide resolved
- 这个变量用于控制是否开启 [TiDB 加速建表](/accelerated-table-creation.md)。
- 从 TiDB v8.0.0 开始,支持使用 `tidb_enable_fast_create_table` 加速建表 [`CREATE TABLE`](/sql-statements/sql-statement-create-table.md)。
- 该变量是由 v7.6.0 中引入的 [`tidb_ddl_version`](https://docs.pingcap.com/zh/tidb/v7.6/system-variables#tidb_ddl_version-从-v760-版本开始引入) 更名而来。从 v8.0.0 开始,`tidb_ddl_version` 不再生效。
- 从 TiDB v8.5.0 版本开始,新建集群 `tidb_enable_fast_create_table` 默认开启,如果是从老版本升级上来,`tidb_enable_fast_create_table` 维持原值。
D3Hunter marked this conversation as resolved.
Show resolved Hide resolved

### `tidb_default_string_match_selectivity` <span class="version-mark">从 v6.2.0 版本开始引入</span>

Expand Down