- 最后登录
- 2012-7-27
- 在线时间
- 3 小时
- 威望
- 13
- 金钱
- 13
- 注册时间
- 2012-3-14
- 阅读权限
- 10
- 帖子
- 3
- 精华
- 0
- 积分
- 13
- UID
- 302
|
1#
发表于 2012-5-9 10:49:01
|
查看: 2927 |
回复: 1
sql语句:
select sum(nvl(dlver_amt, :"SYS_B_0"))
from tb_al046 l, tb_pay_check chk, tb_aj002 j
where l.rcpt_no = chk.rcpt_no
and chk.is_check = :"SYS_B_1"
and chk.real_match = :"SYS_B_2"
and l.ord_id = j.ord_id
and l.ord_seq = j.ord_seq
and j.chg_yn = :"SYS_B_3"
and l.trans_date between :1 and :2 --+ :"SYS_B_4"
and chk.check_date between :3 and :4 --+ :"SYS_B_5"
and l.dlver_cd = :5
and area_nm = :6
修改单列索引为复合索引
drop index IX_TB_AL046_TRANS_DATE;
create index IX_TB_AL046_TRANS_DATE on tb_al046(TRANS_DATE,DLVER_CD) tablespace sale_tablespace_ix;
analyze index IX_TB_AL046_TRANS_DATE compute statistics;
结果:原执行计划中BITMAP CONVERSION FROM ROWIDS消失,但是cost从333升到了6673。复合索引是否应该创建,另外BITMAP CONVERSION FROM ROWIDS是否应该消除? |
-
1.jpg
(139.73 KB, 下载次数: 160)
创建复合索引前执行计划
-
2.jpg
(113.79 KB, 下载次数: 163)
创建复合索引后执行计划
|