读懂trace file (tkprof格式化) 3

任何一个SQL都应该包含以下三个步骤:

a. 分析 (parse) : SQL的分析阶段
b. 执行 (execute) : SQL的执行阶段
c. 数据提取 (fetch) : 数据的提取阶段

分析阶段 -  比较容易理解,解析(软硬解析),比较并输出最好的一个执行计划
执行阶段 -  对于update, insert, delete 这些DML操作,所有的工作都在execute阶段完成了,没有fetch阶段。  select稍微复杂一些,大多数的select语句在execute阶段不做任何事情, 我们做的所有的工作就是打开游标,游标是一个指向shared pool内存区域的一个指针,正常来说,select 在这里不做任何事情(仅仅标识出查询出的行),它只是准备去做,但还未开始。

However, there are exceptions to everything - turn on trace and do a select * from scott.emp FOR UPDATE. That is a select, but it is also an update. You would see work done during the execute as well as the fetch phase. The work done during the execute was that of going out and touching every row and locking it. The work done during the fetch phase was that of going out and retrieving the data back to the client.

数据提取 -  这是我们能看到的select的几乎所有的工作(DML语句不需要),对于insert、update、delete操作,返回记录则是在execute这步。

备注:以上部分翻译自asktom,如需详细解释,请在asktom查询.

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/35489/viewspace-1124819/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/35489/viewspace-1124819/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值