今天对一张表进行批量更新,表数据量在600万左右。使用in匹配手机号更新发现特别慢,in的数量依次1万、1千、1百、十个、5个、1个,发现只有手机号数量小于5的时候才会才会走索引。在官网社区查到了一个哥们和我一样的问题,有大神提供下了下面的解决方案:【急】IN关键字索引失效 | 达梦技术社区 (dameng.com)
select /*+ enable_index_join(1) INDEX("t_evaluation_statistics_test2" "t_evaluation_statistics_test2_batch_id")*/
*from "TEST"."t_evaluation_statistics_test2" where batch_id ...