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

config: clarify the setting of max-index-length #20066

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
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
9 changes: 8 additions & 1 deletion tidb-configuration-file.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,14 @@ TiDB 配置文件比命令行参数支持更多的选项。你可以在 [config/
+ 用于设置新建索引的长度限制。
+ 默认值:3072
+ 单位:Byte
+ 目前的合法值范围 `[3072, 3072*4]`。MySQL 和 TiDB v3.0.11 之前版本(不包含 v3.0.11)没有此配置项,不过都对新建索引的长度做了限制。MySQL 对此的长度限制为 `3072`,TiDB 在 v3.0.7 以及之前版本该值为 `3072*4`,在 v3.0.7 之后版本(包含 v3.0.8、v3.0.9 和 v3.0.10)的该值为 `3072`。为了与 MySQL 和 TiDB 之前版本的兼容,添加了此配置项。
+ 最小值:3072
+ 最大值:12288,即 `3072*4`
+ MySQL 和 TiDB v3.0.11 之前版本(不包含 v3.0.11)没有此配置项,不过都对新建索引的长度做了限制。MySQL 对此的长度限制为 `3072`,TiDB 在 v3.0.7 以及之前版本该值为 `3072*4`,在 v3.0.7 之后版本(包含 v3.0.8、v3.0.9 和 v3.0.10)的该值为 `3072`。为了与 MySQL 和 TiDB 之前版本的兼容,添加了此配置项。

> **注意:**
>
> 对于 `CHAR`、`TEXT` 等非二进制[字符串类型](/data-type-string.md),计算索引长度时需要考虑具体的字符集。例如对于 `UTF8MB4` 字符集,当该配置项设置为 `12288` 时,在 `TEXT` 字段上的索引的最大长度为 `12288/4=3072` 个字符。
>

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

Expand Down