首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > 其他数据库 >

AutoTrace实施结果说明

2013-02-17 
AutoTrace执行结果说明统计信息---------------------299recursive calls0db block gets2359consistent ge

AutoTrace执行结果说明

统计信息---------------------        299  recursive calls          0  db block gets       2359  consistent gets          0  physical reads          0  redo size        410  bytes sent via SQL*Net to client        385  bytes received via SQL*Net from client          2  SQL*Net roundtrips to/from client          5  sorts (memory)          0  sorts (disk)          1  rows processed

?

这些数据就是这条SQL语句的执行状态。下面分别说一下各个数据项的含义:

recursive calls

递归调用-执行SQL的时候的产生的递归调用的数量,这个参数和访问数据字典的次数有很大的关系。一般来说,这个参数值不会很大。

db block gets

DB块取-在发生INSERT,DELETE,UPDATE,SELECT FOR UPDATE的时候,数据库缓冲区中的数据库块的个数。在SELECT语句中一般为0。

db block gets + consistent gets = logical io (as opposed to physical io).

consistent gets

一致性读-除了SELECT FOR UPDATE的时候,从数据库缓冲区中读取的数据块的个数

db block gets + consistent gets = logical io (as opposed to physical io)

physical reads

物理读-physical reads = physical io (as opposed to logical io)

redo size

重做日志大小-执行SQL的过程中,产生的重做日志的大小

bytes sent via SQL*Net to client

通过sql*net发送给客户端的字节数

bytes received via SQL*Net from client

通过sql*net接受客户端的字节数

sql*net roundtrips to/from client

See how setting the arraysize affects SQL*Net roundtrips to/from client.

sorts(memory)

在内存中发生的排序

sorts(disk)

不能在内存中发生的排序,需要硬盘来协助

rows processed

结果的记录数

?

用AutoTrace进行优化的注意事项

1. 可以通过设置timing来得到执行SQL所用的时间,但不能仅把这个时间来当作SQL执行效率的唯一量度。这个时间会包括进行AUTOTRACE的一些时间消耗,所以这个时间并不仅仅是SQL执行的时间。这个时间会与SQL执行时间有一定的误差,而在SQL比较简单的时候尤为明显。

2. 判断SQL效率高低应该通过执行SQL执行状态里面的逻辑读的数量

热点排行