oracle 索引失效的场景

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/baofengyu90/article/details/84404252

1、索引列使用如下条件,like '%abc%'、is null/is not null、!=或<>、not in

not in 应该改为not exists 

2、索引列使用了函数,例如

select * from t where f(index_column) = value 

eg:select * from t where sub(name,1,3) = 'abc'

3、索引列参与运算

select * from t where index_column/2 > 1

应改为select * from t where index_column > 2

4、count(*)

(4参考书中<Oracle9i&10g编程艺术:深入数据库体系结构>上的)

猜你喜欢

转载自blog.csdn.net/baofengyu90/article/details/84404252