为提高效率,提问时请提供以下信息,问题描述清晰可优先响应。
- 【TiDB 版本】:v4.0.0
- 【问题描述】:
表user_topic有字段topic_ic和score建立联合索引 idx_score
(topic_id
,score
)
select * from user_topic where topic_id in (29,31) limit 1;
这条语句命中索引 符合预期
select * from user_topic where topic_id in (29,31) order by score limit 1;
加上order by score 速度非常慢 疑似未使用到idx_score索引。