oracle 如何创建联合索引
1、创建表

2、插入数据

3、创建索引

4、我们开始执行下面的SQLselect * from sunyang_test where b=5000;

5、select * from sunyang_test where c=5000;

6、select * from sunyang_test where a=1 and b=5000;

7、select * from sunyang_test where a=1 and c=5000;

8、select * from sunyang_test where b=5000 and c=5000;

9、select * from sunyang_test where a=1 and b=5000 and c=5000;

10、可以看到,在a列区分度不大,且需要a、b、c单列查询或组合查询时,这样建索引将所有查询情况都覆盖到了,并且索引不复杂。
声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
阅读量:89
阅读量:59
阅读量:39
阅读量:58
阅读量:74