指定索引和不指定索引的选择,请支招。

[复制链接]
查看11 | 回复1 | 2010-10-8 09:32:27 | 显示全部楼层 |阅读模式
有个SQL统计语句很消耗CPU资源,通过分析执行计划发现指定索引和指定索引区别很大,我该怎么选择,请大家帮忙。
---指定索引--------
---不指定索引----------------
COST:550,CPU:11M
COST:298,CPU:27M
Elapsed: 00:00:00.03
Elapsed: 00:00:00.08
Statistics(指定索引)
Statistics(不指定索引)
---------------------------------------------------------- ----------------------------------------------------------

4recursive calls
4recursive calls

29db block gets
29db block gets

432consistent gets
382consistent gets

15physical reads
15physical reads

1532redo size
1488redo size

1388bytes sent via SQL*Net to client
1388bytes sent via SQL*Net to client

2836bytes received via SQL*Net from client2838bytes received via SQL*Net from client

3SQL*Net roundtrips to/from client
3SQL*Net roundtrips to/from client


2sorts (memory)
2sorts (memory)


0sorts (disk)
0sorts (disk)

23rows processed
23rows processed
详细计划请见附件.
[ 本帖最后由 xuwh 于 2010-10-17 22:08 编辑 ]
回复

使用道具 举报

千问 | 2010-10-8 09:32:27 | 显示全部楼层
貌似效率都不咋地,建议调整
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行