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

Doc for Pipelined DML #16713

Merged
merged 28 commits into from
Mar 20, 2024
Merged
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
0e9d83a
variable: tidb_dml_type
ekexium Feb 29, 2024
8d3cc86
experimental warning
ekexium Mar 4, 2024
d2cbc82
document pessimistic-auto-commit
ekexium Mar 4, 2024
7a94035
add a section in configure-memory-usage.md
ekexium Mar 4, 2024
9e58784
clarify affected statements
ekexium Mar 7, 2024
7b15660
Apply suggestions from code review
ekexium Mar 7, 2024
1f7541f
add support for REPLACE stmt
ekexium Mar 7, 2024
74b996a
Apply suggestions from code review
Oreoxmt Mar 7, 2024
840db84
document incompatibility with temp-table
ekexium Mar 8, 2024
254cc40
Apply suggestions from code review
Oreoxmt Mar 11, 2024
f55c4ff
Apply suggestions from code review
Oreoxmt Mar 11, 2024
3b8891f
document incompatibility with foreign keys
ekexium Mar 12, 2024
e70bc78
Update system-variables.md
ekexium Mar 12, 2024
f9a48c2
tidb_dml_type=bulk will override pessimistic-auto-commit config
ekexium Mar 13, 2024
3af6931
document incompatibility with cached tables
ekexium Mar 13, 2024
f856fbd
Merge branch 'pipelined-dml' of github.com:ekexium/docs-cn into pipel…
ekexium Mar 13, 2024
47f98b7
comment pessimistic-auto-commit config
ekexium Mar 13, 2024
6d68e60
document max-txn-ttl and gc impact
ekexium Mar 13, 2024
9f776df
Apply suggestions from code review
ekexium Mar 14, 2024
305e21d
make ci happy
Oreoxmt Mar 14, 2024
d9220f4
Apply suggestions from code review
Oreoxmt Mar 14, 2024
8b0b879
document requirement of metadata lock
ekexium Mar 14, 2024
ebbe5e1
Apply suggestions from code review
ekexium Mar 15, 2024
8d2819d
document incompatibility with FK referenced table
ekexium Mar 18, 2024
ba78a5b
document the fallback behavior
ekexium Mar 18, 2024
740fd94
Apply suggestions from code review
ekexium Mar 19, 2024
3f3cb36
Apply suggestions from code review
Oreoxmt Mar 19, 2024
9199abc
refine wording
Oreoxmt Mar 19, 2024
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
20 changes: 20 additions & 0 deletions system-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -1594,6 +1594,26 @@ mysql> SELECT job_info FROM mysql.analyze_jobs ORDER BY end_time DESC LIMIT 1;
>
> 自 v7.0.0 起,`tidb_dml_batch_size` 对 [`LOAD DATA` 语句](/sql-statements/sql-statement-load-data.md)不再生效。

### `tidb_dml_type` <span class="version-mark">从 v8.0 版本开始引入</span>
ekexium marked this conversation as resolved.
Show resolved Hide resolved

ekexium marked this conversation as resolved.
Show resolved Hide resolved
- 作用域:SESSION
- 是否持久化到集群:否
Oreoxmt marked this conversation as resolved.
Show resolved Hide resolved
- 是否受 Hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value) 控制:是
- 类型:字符串
- 默认值:`"standard"`
- 可选值:`"standard"`、`"bulk"`
- 该变量用来设置 DML 语句的执行方式。
- `"standard"` 表示使用标准的 DML 执行方式,TiDB 事务在提交前缓存在内存中。这种模式能高效处理高并发、可能冲突的事务。除非有明确的需求,应当使用这种方式。
- `"bulk"` 表示使用批量 DML 执行方式,这种方式适用于写入大批量数据导致 TiDB 内存使用过多时使用。
- 在 TiDB 事务执行过程中,数据不全部缓存在 TiDB 内存中,而是持续写入 TiKV,以此降低内存占用。
- 这种方式不能高效处理写入冲突场景,仅适用于无冲突的大批量数据的写入场景。
- BULK 方式只对 auto-commit 的语句生效。
- 这种方式由 Pipelined-DML 特性实现。

> **注意:**
>
> `tidb_dml_type` 的 BULK 方式是实验性特性,以此方式执行超大事务时对 TiCDC、TiFlash、TiKV resolved-ts 模块的内存使用和执行效率都有影响,有 OOM 风险。不建议在启用这些组件和功能时使用。

### `tidb_enable_1pc` <span class="version-mark">从 v5.0 版本开始引入</span>

- 作用域:SESSION | GLOBAL
Expand Down
Loading