Skip to content

Commit

Permalink
update TTL doc to allow split tasks for utf8 colum
Browse files Browse the repository at this point in the history
  • Loading branch information
lcwangchao committed Aug 27, 2024
1 parent 75704b3 commit 93e7983
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion time-to-live.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,11 @@ Currently, the TTL feature has the following limitations:
* The TTL attribute cannot be set on temporary tables, including local temporary tables and global temporary tables.
* A table with the TTL attribute does not support being referenced by other tables as the primary table in a foreign key constraint.
* It is not guaranteed that all expired data is deleted immediately. The time when expired data is deleted depends on the scheduling interval and scheduling window of the background cleanup job.
* For tables that use [clustered indexes](/clustered-indexes.md), if the primary key is neither an integer nor a binary string type, the TTL job cannot be split into multiple tasks. This will cause the TTL job to be executed sequentially on a single TiDB node. If the table contains a large amount of data, the execution of the TTL job might become slow.
* For tables that use [clustered indexes](/clustered-indexes.md), TTL tasks are split into multiple subtasks only in the following scenarios:
- The first column of the primary key or composite primary key is of integer or binary string type.
- The character set of the first column of the primary key or composite primary key is `utf8` or `utf8mb4` and the collate is `utf8_bin`, `utf8mb4_bin` or `utf8mb4_0900_bin`.
- For tables that do not support splitting TTL job to multiple subtasks, the TTL job will be executed sequentially on a single TiDB node. If the table contains a large amount of data, the execution of the TTL job might become slow.
- For tables where the primary key column type is `utf8` or `utf8mb4`, subtasks are split only based on the range of visible ASCII characters. If a large number of primary key values have the same ASCII prefix, it may cause uneven task splitting.

Check warning on line 264 in time-to-live.md

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [PingCAP.Ambiguous] Consider using a clearer word than 'a large number of' because it may cause confusion. Raw Output: {"message": "[PingCAP.Ambiguous] Consider using a clearer word than 'a large number of' because it may cause confusion.", "location": {"path": "time-to-live.md", "range": {"start": {"line": 264, "column": 151}}}, "severity": "INFO"}

## FAQs

Expand Down

0 comments on commit 93e7983

Please sign in to comment.