有一样表test 建表语句如下所示,该表数据量10亿,有这一样条sql,
select * from test where (key1>? or(key1=? and key2>?) or (key1=? and key2=? and key3>?)) and (key1<? or(key1=? and key2<?) or (key1=? and key2=? and key3<?)) order by key1 asc,key2 asc,key3 asc;
这条sql 改怎么优化,test表的主键是b树索引。mysql 支持row comparisons 语法
支持这种形式(key1,key2,key3) > (?,?,?) and (key1,key2,key3)<=(?,?,?),那么oracle该怎么优化呢?求大牛指点
create table test
(
key1 int,
key2 int,
key3 int,
value int,
primary key(key1,key2,key3)
)