配送已到货订单号查询 sql 语句优化

select c0501 "订单编号",
c0503 "供应商编码",a0302 "供应商名称",
to_char(c0515,'yyyy.mm.dd') "订货日期",
to_char(c0516,'yyyy.mm.dd') "预定交货日期"
from c05,a03 where c0503=a0301 and
c0502='01' and to_char(c0515,'yyyy.mm.dd')
between '2009.02.01' and '2009.02.28' and c0523='4'
SELECT STATEMENT, GOAL = CHOOSE Cost=500 Cardinality=1059

Bytes=69894
HASH JOIN Cost=500 Cardinality=1059 Bytes=69894
TABLE ACCESS FULL Object owner=FZDC Object name=C05 Cost=486

Cardinality=23 Bytes=667
TABLE ACCESS FULL Object owner=FZDC Object name=A03 Cost=13 Cardinality=15193

Bytes=562141

-------------------------1.75
-------------------------1.75
-------------------------1.75
create index IND_C05_C0515 on c05(c0515)
analyze table c05 compute statistics

select c0501 "订单编号",
c0503 "供应商编码",a0302 "供应商名称",
to_char(c0515,'yyyy.mm.dd') "订货日期",
to_char(c0516,'yyyy.mm.dd') "预定交货日期"
from c05,a03 where c0503=a0301 and
c0502='01' and c0515
between to_date('2009.02.01','yyyy-mm-dd') and to_date('2009.02.28','yyyy-mm-dd')
and c0523='4'
SQL Statement from editor:


select c0501 "订单编号",
c0503 "供应商编码",a0302 "供应商名称",
to_char(c0515,'yyyy.mm.dd') "订货日期",
to_char(c0516,'yyyy.mm.dd') "预定交货日期"
from c05,a03 where c0503=a0301 and
c0502='01' and c0515
between to_date('2009.02.01','yyyy-mm-dd') and to_date('2009.02.28','yyyy-mm-dd')
and c0523='4'
------------------------------------------------------------

Statement Id=100 Type=
Cost=1.95941868211261E-307 TimeStamp=20-04-10::10::45:17

(1) SELECT STATEMENT CHOOSE
Est. Rows: 344 Cost: 153
(6) NESTED LOOPS
Est. Rows: 344 Cost: 153
(3) TABLE ACCESS BY INDEX ROWID FZDC.C05 [Analyzed]
(3) Blocks: 27,580 Est. Rows: 13 of 1,052,721 Cost: 140
Tablespace: FZ_DAT
(2) NON-UNIQUE INDEX RANGE SCAN FZDC.IND_C05_C0515 [Analyzed]
Est. Rows: 2,101 Cost: 6
(5) TABLE ACCESS BY INDEX ROWID FZDC.A03 [Not Analyzed]
(5) Est. Rows: 27 Cost: 1
Tablespace: FZ_DAT
(4) UNIQUE INDEX UNIQUE SCAN FZDC.SYS_C0012284 [Not Analyzed]
Est. Rows: 1
-----------------------------------0.125
-----------------------------------0.11
-----------------------------------0.094

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值