博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
关于执行计划里recursive calls,db block gets和consistent gets参数的解释
阅读量:2427 次
发布时间:2019-05-10

本文共 2892 字,大约阅读时间需要 9 分钟。

我们在实际工作中经常要看某个sql语句的执行计划,例如:

在sqlplus使用命令SET AUTOTRACE ON后,执行计划显示如下:

SELECT STATEMENT Optimizer=ALL_ROWS (Cost=985 Card=1 Bytes=26)
Statistics
----------------------------------------------------------
35 recursive calls
0 db block gets
1052 consistent gets
7168 physical reads
0 redo size
395 bytes sent via SQL*Net to client
512 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
1 rows processed
其中recursive calls,db block gets,consistent gets的具体含义是什么?

具体解释如下:

· Recursive Calls. Number of recursive calls generated at both the user and system level.

Oracle Database maintains tables used for internal processing. When it needs to change these tables, Oracle Database generates an internal SQL statement, which in turn generates a recursive call.
In short, recursive calls are basically SQL performed on behalf of your SQL. So, if you had to parse the query, for example, you might have had to run some other queries to get data dictionary information. These would be recursive calls. Space management, security checks, calling PL/SQL from SQL—all incur recursive SQL calls.
· DB Block Gets. Number of times a CURRENT block was requested.
Current mode blocks are retrieved as they exist right now, not in a consistent read fashion.
Normally, blocks retrieved for a query are retrieved as they existed when the query began. Current mode blocks are retrieved as they exist right now, not from a previous point in time.
During a SELECT, you might see current mode retrievals due to reading the data dictionary to find the extent information for a table to do a full scan (because you need the "right now" information, not the consistent read). During a modification, you will access the blocks in current mode in order to write to them.
(DB Block Gets:请求的数据块在buffer能满足的个数)
· Consistent Gets. Number of times a consistent read was requested for a block.
This is how many blocks you processed in "consistent read" mode. This will include counts of blocks read from the rollback segment in order to roll back a block.
This is the mode you read blocks in with a SELECT, for example.
Also, when you do a searched UPDATE/DELETE, you read the blocks in consistent read mode and then get the block in current mode to actually do the modification.
(Consistent Gets:数据请求总数在回滚段Buffer中)
· Physical Reads. Total number of data blocks read from disk. This number equals the value of "physical reads direct" plus all reads into buffer cache. (Physical Reads:实例启动后,从磁盘读到Buffer Cache数据块数量)
· Sorts (disk). Number of sort operations that required at least one disk write. Sorts that require I/O to disk are quite resource intensive. Try increasing the size of the initialization parameter SORT_AREA_SIZE.

[@more@]

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

转载于:http://blog.itpub.net/7916042/viewspace-892745/

你可能感兴趣的文章
Kafka精华问答 | kafka节点之间如何备份?
查看>>
来华30载,这些都是Oracle的神来之笔……
查看>>
Kubernetes要成为一个企业友好平台,到底还缺啥?
查看>>
云数据库精华问答 | 云数据库与其他数据库的关系
查看>>
美国专利机构榜单:华为、京东方进前20名;印度巨头信实与微软结盟;三星发布 1.08 亿像素传感器,小米参与合作……...
查看>>
5G基站功耗,到底有多大?
查看>>
行!这下 CSDN 玩大了!粉丝:太良心
查看>>
Spark精华问答 | 怎么运行Spark?
查看>>
百度积极回应阿波龙项目不实报道;半数开发者认为学习新语言很困难;腾讯在长沙建立首个智慧产业总部……...
查看>>
数据中台与苏秦挂六国相印
查看>>
苹果遭集体诉讼;华为或年底推出鸿蒙系统中低端智能手机;Facebook雇人记录用户语音通话以改善AI技术……...
查看>>
云化要求下,数据库架构如何演进?
查看>>
5G精华问答 | 5G关键技术解读
查看>>
10个业界最流行的Kubernetes发行版
查看>>
微软发布 Azure 物联网安全中心;阿里巴巴在美申请专利,以实现跨区块链统一管理;Google利用足球训练下一代人工智能……...
查看>>
如何证明你不是在开发垃圾?
查看>>
微服务精华问答 | 为什么需要微服务?
查看>>
当我们谈AI时,到底该谈什么?
查看>>
kafka系统设计开篇
查看>>
2019全球编程语言高薪排行榜登场;余承东正式宣布华为IFA2019 或发布麒麟990;OPPO、vivo和小米成立互传联盟…...
查看>>