1>INDEX类型:
%7 ,%40(有顺序的表)
1>B* index
0>heap table :
1>IOT
create table a(field1 number, field2 number)
organization index
2>CLUSTER INDEX
create cluster emp_dept_cluster
(deptno number(2) size 1024
create index emp_dept_idx on cluster emp_dept_cluster
create table dept(depno number primary key,dname,varchar2(14),loc varchar2(13))
cluster emp_dept_cluster(deptno)
create table emp(empno number ,emp_name varchar2(14),deptno number(2) references dept(deptno))
cluster emp_dept_cluster(deptno)
3>REVERSE KEY INDEX
4>DESCENDING INDEX
1>Bitmap index
低差异系数,少修改。
2>Bitmap join index
create bitmap index emp_bm_index
on emp(d.dname) from emp e, dept d where e.deptno=d.deptno
3>applycation domain index
4>function-based index
心得:
可以对一个表部分数据行索引:
create index b_idx(case when field1 'N' then 'N' end);
create index c_idx(case when status='ACTIVE' then name end);
2>为何没有使用我的索引:
1>CBO
2>条件使用了函数
3>隐式转换
4>count(*)
5>CBO 通过耗用时间和IO次数来判定。
6>有一段时间没有分析某个表了。
7〉表中的两个列进行比较的情况。。
8〉not in,not exist,column<>value,column>value或column<value
9>使用了single-row function 时,如nvl,to_char,lower
example: select ename, nvl(comm,0) from emp;
3>复合索引的,索引字段的顺序思考 :
create index on table1(a,b) or create index on table(b,a)
or create index on table1(a,b) compress 2;
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/8568259/viewspace-2102982/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/8568259/viewspace-2102982/