注册

关于IN查询数量的问题

Bobby 2026/02/03 216 3

为提高效率,提问时请提供以下信息,问题描述清晰可优先响应。
【DM版本】: DM Database Server 64 V8
【操作系统】:uelc20
【CPU】: Huawei,Kunpeng 920
【问题描述】*:
查询SQL如下:
select * from fast_enterprise_source_item e where e.source_id in (
2018525164001566729,
2018525164001566731,
2018525164001566733,
2018525164001566735,
2018525164001566737
);

select * from fast_enterprise_source_item e where e.source_id in (
2018525164001566729,
2018525164001566731,
2018525164001566733,
2018525164001566735,
2018525164001566737,
2018525164001566738
);

目标数据表fast_enterprise_source_item数据量一千万,source_id有索引,当in中的值为5个时,响应很快,243ms,in中的值为6个时,响应很慢很慢116563ms,explain发现,5个的走了索引,6个的没走,强制指定索引后变快。
有没有什么配置可以设置,这个in的数量来控制底层判断逻辑

回答 0
暂无回答
扫一扫
联系客服