select /*+index(t_department PK_T_DEPARTMENT)*/ * from t_department t where dept_id like '3701%' --不走索引
select /*+index(t_department PK_T_DEPARTMENT)*/ * from t_department t where dept_id like '4401%' --走索引
select /*+index(t_department PK_T_DEPARTMENT)*/ * from t_department t where dept_id like '370111%' --走索引
select /*+index(t_department PK_T_DEPARTMENT)*/ count(*) from t_department t where dept_id like '3701%' --走索引
为什么加了/*+*/后,不能强制走索引呢?而且上面的现象有时走索引有时不走,怎么解释?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货