INDEX 学习笔记

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/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值