oracle索引

以下内容属于自己亲身测试
数据库11.2.0.3
create table abc(
dzsph number(20),
jylsh number(4)
)
--复合索引
如果这样创建索引 create unique u_index on abc (dzsph,jylsh);
select * from abc where dzsph=88888 走的是 index range scan
如果 where jylsh=89888 走的是 index full scan
如果这样创建索引 create unique u_index on abc (jylsh,dzsph);
走的是 index full scan,如果 where dzsph=88888 and jylsh=7777
那走的就是 index unique scan;
随着数据量增加 索引还是(dzsph,jylsh) 情况  where jylsh=89888 走的是
index skip scan 也有可能是 table access full 不一定

猜你喜欢

转载自wangtianhui.iteye.com/blog/2144657