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

document INSERT IGNORE ON DUP for pipelined dml #17203

Merged
merged 2 commits into from May 13, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion system-variables.md
Expand Up @@ -1619,7 +1619,7 @@ mysql> SELECT job_info FROM mysql.analyze_jobs ORDER BY end_time DESC LIMIT 1;
- `"standard"` 表示使用标准的 DML 执行方式,TiDB 事务在提交前缓存在内存中。适用于处理高并发且可能存在冲突的事务场景,为默认推荐使用的执行方式。
- `"bulk"` 表示使用批量 DML 执行方式,适合于处理因大量数据写入导致 TiDB 内存使用过多的情况。
- 在 TiDB 事务执行过程中,数据不是完全缓存在 TiDB 内存中,而是持续写入 TiKV,以减少内存的占用,同时平滑写入压力。
- 只有 `INSERT`、`UPDATE`、`REPLACE` 和 `DELETE` 语句受 `"bulk"` 方式的影响。
- 只有 `INSERT`、`UPDATE`、`REPLACE` 和 `DELETE` 语句受 `"bulk"` 方式的影响。由于 `"bulk"` 模式流水线执行的方式,其中 `INSERT IGNORE ... ON DUPLICATE UPDATE ...` 的用法可能会在更新造成冲突时报出 `Duplicate entry` 错误,而在 `"standard"` 模式下,由于设置了 IGNORE 关键字,该错误会被忽略,不会返回给用户。
lilin90 marked this conversation as resolved.
Show resolved Hide resolved
- `"bulk"` 方式仅适用于大批量**无冲突数据写入**的场景,不能高效处理写入冲突的场景,写写冲突可能会导致大批量事务提交失败并被回滚。
- `"bulk"` 方式只对自动提交 (auto-commit) 的语句生效。当设置为 `"bulk"` 时,[`pessimistic-auto-commit`](/tidb-configuration-file.md#pessimistic-auto-commit) 配置项的效果等同于设置为 `false`。
- 使用 `"bulk"` 方式执行语句时,需要确保在语句执行过程中保持[元数据锁](/metadata-lock.md)处于开启状态。
Expand Down