in不会导致索引失效,但最终数据库会将in语句解析为or语句,eg:

select * from T_MAIN_PROCESS t where t.audit_status_code in ('05','07')。 查看执行计划会被解析成:

select * from T_MAIN_PROCESS t where t.audit_status_code='05' or t.audit_status_code='07'

所以:可用or代替in,减少数据库解析in语句时间。

 

not in 会导致索引失效。所以

相关文章:

  • 2022-12-23
  • 2021-12-14
  • 2022-12-23
  • 2021-10-14
猜你喜欢
  • 2022-12-23
  • 2021-06-11
  • 2021-09-29
  • 2021-12-08
  • 2021-06-25
  • 2021-11-07
  • 2022-12-23
相关资源
相似解决方案