Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.Original topic: 查询发现联合索引没走

[TiDB Usage Environment] Production Environment / Testing / PoC
[TiDB Version]
[Reproduction Path] What operations were performed when the issue occurred
[Encountered Issue: Issue Phenomenon and Impact]
[Resource Configuration]
[Attachments: Screenshots/Logs/Monitoring]
A composite index was created on a table with millions of records, all of which are char(). However, a simple query does not use this index and instead performs a full table scan. Health checks and admin checks were done, but the specific reason is unclear. The query takes 4 seconds, while the same query on SQL Server with more data takes only a little over 2 seconds.
City
char(36) COLLATE utf8mb4_general_ci DEFAULT NULL,
Version
char(36) COLLATE utf8mb4_general_ci DEFAULT NULL,
KEY idx_city_version
(City
,Version
)