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

update TTL doc to allow split tasks for utf8 column #18457

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
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
11 changes: 10 additions & 1 deletion time-to-live.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,16 @@ TTL 功能能够与 TiDB 的迁移、备份、恢复工具一同使用。
* 不允许在临时表上设置 TTL 属性,包括本地临时表和全局临时表。
* 具有 TTL 属性的表不支持作为外键约束的主表被其他表引用。
* 不保证所有过期数据立即被删除,过期数据被删除的时间取决于后台清理任务的调度周期和调度窗口。
* 对于使用[聚簇索引](/clustered-indexes.md)的表,如果主键的类型不是整数类型或二进制字符串类型,TTL 任务将无法被拆分成多个子任务。这将导致 TTL 任务只能在一个 TiDB 节点上按顺序执行。如果表中的数据量较大,TTL 任务的执行可能会变得缓慢。
* 对于使用[聚簇索引](/clustered-indexes.md)的表,仅支持在以下场景中将 TTL 任务拆分成多个子任务:
- 主键或者复合主键的第一列为整数或二进制字符串类型。其中,二进制字符串类型主要指下面几种:
- `CHAR(N) CHARACTER SET BINARY`
- `VARCHAR(N) CHARACTER SET BINARY`
- `BINARY(N)`
- `VARBINARY(N)`
- `BIT(N)`
- 主键或者复合主键的第一列的字符集为 `utf8` 或者 `utf8mb4`,且排序规则设置为 `utf8_bin`、 `utf8mb4_bin` 或者 `utf8mb4_0900_bin`。
* 对于主键第一列的字符集类型是 `utf8` 或者 `utf8mb4` 的表,仅会根据 ASCII 可见字符的范围进行子任务拆分。如果大量的主键值具有相同的 ASCII 前缀,可能会造成任务拆分不均匀。
* 对于不支持拆分 TTL 子任务的表,TTL 任务只能在一个 TiDB 节点上按顺序执行。此时如果表中的数据量较大,TTL 任务的执行可能会变得缓慢。
hfxsd marked this conversation as resolved.
Show resolved Hide resolved
hfxsd marked this conversation as resolved.
Show resolved Hide resolved

## 常见问题

Expand Down