关于避免模糊查询索引时效问题

当  waybill_no 存在索引时 

select *
from ucmp_waybill_rec_mem r
where r.createtm >= trunc(sysdate - 1) 
and r.type = '2'
and r.waybill_no like '033%'

select *
from ucmp_waybill_rec_mem r
where to_char(r.createtm) > '2016-01-29'
and r.type = '2'
and substr( r.waybill_no,1,3) ='033'

当数据为一亿条时,第一条一个半小时尚不能查处,第二条4分钟解决,

我知道索引会失效,但是没第一时间想办法避免,导致拖延了时间,切记

在索引失效时,想办法避免,并且有方法避免

原文地址:https://www.cnblogs.com/lianshan/p/5174731.html