From 57bb33b3ccb483a76500815a5ea18e43bc9554a7 Mon Sep 17 00:00:00 2001 From: tiancaiamao Date: Fri, 13 Mar 2020 09:42:16 +0800 Subject: [PATCH 1/4] reference/configuration: add description about TiDB txn-total-size-limit --- reference/configuration/tidb-server/configuration-file.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/reference/configuration/tidb-server/configuration-file.md b/reference/configuration/tidb-server/configuration-file.md index 917c5886c880..47e58d838c0f 100644 --- a/reference/configuration/tidb-server/configuration-file.md +++ b/reference/configuration/tidb-server/configuration-file.md @@ -243,6 +243,12 @@ TiDB 配置文件比命令行参数支持更多的选项。你可以在 [config/ + 默认值:0 + 这个配置只有在 prepared-plan-cache.enabled 为 true 的情况才会生效。在 LRU 的 size 大于 prepared-plan-cache.capacity 的情况下,也会剔除 LRU 中的元素。 +### `txn-total-size-limit` + ++ TiDB 事务大小限制 ++ 默认值:104857600 ++ 单个事务中,所有的 key-value 记录的总大小不能超过该限制。注意,如果 `binlog` 开启了,该配置项的值不能超过 104857600(100M),因为 `binlog` 组件不支持同步的事务过大;如果 `binlog` 没开启,该配置项的最大值不超过 10737418240(10G)。 + ### `stmt-count-limit` + TiDB 一个事务允许的最大语句条数限制。 From 6ddda388aa78622cb7b1061eaa6378c7f7491c68 Mon Sep 17 00:00:00 2001 From: tiancaiamao Date: Wed, 1 Apr 2020 15:45:04 +0800 Subject: [PATCH 2/4] address comment --- reference/configuration/tidb-server/configuration-file.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/configuration/tidb-server/configuration-file.md b/reference/configuration/tidb-server/configuration-file.md index d7ebbdd9f0f1..c0b6dbbe2290 100644 --- a/reference/configuration/tidb-server/configuration-file.md +++ b/reference/configuration/tidb-server/configuration-file.md @@ -255,8 +255,8 @@ TiDB 配置文件比命令行参数支持更多的选项。你可以在 [config/ ### `txn-total-size-limit` + TiDB 事务大小限制 -+ 默认值:104857600 -+ 单个事务中,所有的 key-value 记录的总大小不能超过该限制。注意,如果 `binlog` 开启了,该配置项的值不能超过 104857600(100M),因为 `binlog` 组件不支持同步的事务过大;如果 `binlog` 没开启,该配置项的最大值不超过 10737418240(10G)。 ++ 默认值:104857600 (Byte) ++ 单个事务中,所有 key-value 记录的总大小不能超过该限制。注意,如果开启了 `binlog`,该配置项的值不能超过 `104857600`(表示 100M),因为 `binlog` 组件不支持同步的事务过大。如果 `binlog` 没开启,该配置项的最大值不超过 10737418240(表示 10G)。 ### `stmt-count-limit` From 74263cf91b60c854fe6ba6a177568c5dbfbe0342 Mon Sep 17 00:00:00 2001 From: tiancaiamao Date: Wed, 1 Apr 2020 15:52:01 +0800 Subject: [PATCH 3/4] addrss commnt --- reference/transactions/overview.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/reference/transactions/overview.md b/reference/transactions/overview.md index 2c88227ca50e..752f75ec56c9 100644 --- a/reference/transactions/overview.md +++ b/reference/transactions/overview.md @@ -209,3 +209,5 @@ COMMIT; 为了使性能达到最优,建议每 100~500 行写入一个事务。 TiDB 设置了单个事务的键值对的总大小不超过 100 MB,这个默认值可以通过配置文件中的配置项 `txn-total-size-limit` 进行修改,最大支持到 10GB。实际的单个事务大小限制还取决于用户的内存,执行大事务时 TiDB 进程的内存消耗大约是事务大小 6 倍以上。 + +在 4.0 以前的版本,TiDB 限制了单个事务的键值对的总数量不超过 30 万条,在 4.0 之后的版本没有这项限制。 From 3b5db9a65de70cf315cc6d3ddca47af01b38c276 Mon Sep 17 00:00:00 2001 From: TomShawn <41534398+TomShawn@users.noreply.github.com> Date: Wed, 1 Apr 2020 16:46:56 +0800 Subject: [PATCH 4/4] refine format --- reference/configuration/tidb-server/configuration-file.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/configuration/tidb-server/configuration-file.md b/reference/configuration/tidb-server/configuration-file.md index c0b6dbbe2290..74ed5ada45ae 100644 --- a/reference/configuration/tidb-server/configuration-file.md +++ b/reference/configuration/tidb-server/configuration-file.md @@ -256,7 +256,7 @@ TiDB 配置文件比命令行参数支持更多的选项。你可以在 [config/ + TiDB 事务大小限制 + 默认值:104857600 (Byte) -+ 单个事务中,所有 key-value 记录的总大小不能超过该限制。注意,如果开启了 `binlog`,该配置项的值不能超过 `104857600`(表示 100M),因为 `binlog` 组件不支持同步的事务过大。如果 `binlog` 没开启,该配置项的最大值不超过 10737418240(表示 10G)。 ++ 单个事务中,所有 key-value 记录的总大小不能超过该限制。注意,如果开启了 `binlog`,该配置项的值不能超过 `104857600`(表示 100MB),因为 binlog 组件不支持同步的事务过大。如果 `binlog` 没开启,该配置项的最大值不超过 `10737418240`(表示 10GB)。 ### `stmt-count-limit`