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

include limitation of LIKE when it works with non-binary collation (#15443) #15445

Merged
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions character-set-and-collation.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ SHOW COLLATION;
> **警告:**
>
> TiDB 会错误地将 `latin1` 视为 `utf8` 的子集。当用户存储不同于 `latin1` 和 `utf8` 编码的字符时,可能会导致意外情况出现。因此强烈建议使用 `utf8mb4` 字符集。详情参阅 [TiDB #18955](https://github.com/pingcap/tidb/issues/18955)。
>
> 如果查询条件中包含对字符串前缀的 `LIKE` 过滤, 比如 `LIKE 'prefix%'`,并且该列被设置为非二进制排序规则(即排序规则的后缀不是以 `_bin` 结尾),那么 TiDB 优化器暂时无法把这个过滤条件转化为范围扫描 (Range Scan),而是用全量扫描代替。因此这类 SQL 有可能造成超出预期的资源消耗。

> **注意:**
>
Expand Down
2 changes: 2 additions & 0 deletions character-set-gbk.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ SHOW COLLATION WHERE CHARSET = 'gbk';

* 对于 `ENUM` 和 `SET` 类型中的二进制字符,TiDB 目前都会将其作为 `utf8mb4` 字符集处理。

* 如果查询条件中包含对字符串前缀的 `LIKE` 过滤,比如 `LIKE 'prefix%'`,并且该列被设置为 GBK 的排序规则(`gbk_bin` 或 `gbk_chinese_ci`),那么 TiDB 优化器暂时无法把这个过滤条件转化为范围扫描 (Range Scan),而是用全量扫描代替。因此这类 SQL 有可能造成超出预期的资源消耗。

## 组件兼容性

* TiFlash 目前不支持 GBK 字符集。
Expand Down