select *
from table
where A=:X1
and B=:X3
and C=:X4
有复合索引create index IDX0 on table(A, E, C, B)
现在的执行计划是
index range scan
table access by index rowid
filter
我把查询改成
select *
from table
where A=:X1
and B=:X2
and C=:X4
执行计划是
index range scan
table access by index rowid
这样就不用filter了,省去了很多时间,但是这样又不复合逻辑
我的想法是在第一个查询的时候就不要filter了,因为我建了B栏位的索引呀,难道是>=,=:X3
and C=:X4
如果把X1,X2改成常量的话
执行计划是
index range scan
table access by index rowid