recursive calls
来源:互联网 发布:剑灵灵族正太捏脸数据 编辑:程序博客网 时间:2024/05/16 17:13
本文转自http://blog.csdn.net/rulev5/article/details/6988180
recursive calls(重点讲解)
官网对recursive calls 的解释如下:
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。
IBM上面也有一篇讲解,有兴趣可以看看
http://publib.boulder.ibm.com/tividd/td/ITMD/SC23-4724-00/en_US/HTML/oraclepac510rg59.htm
总结一下:
当执行一条SQL语句时,产生的对其他SQL语句的调用,这些额外的语句称之为''recursive calls''或''recursive SQL statements''.
在IBM 的那片文档里讲了触发Recursive Call的6种情况:
如:
(1)我们做一条insert 时,没有足够的空间来保存row记录,Oracle 通过Recursive Call 来动态的分配空间。
(2)执行DDL语句时,ORACLE总是隐含的发出一些recursive SQL语句,来修改数据字典信息,以便成功的执行该DDL语句。
(3)当Shared Pool过小,data dictionary cache 也会相应的过小,没有足够的空间存储ORACLE的系统数据字典信息时,会发生Recursive calls,这些Recursive calls会将数据字典信息从硬盘读入内存中。
(4)存储过程、触发器内如果有SQL调用的话,也会产生recursive SQL。
在这些情况中,主要是对数据字典的查询,通常发生在第一次执行时,第二次执行一般可显著降低。递归需要消耗大量的资源,如果操作复杂,很容易出现问题!
现在让我们举例说明:
- SQL> select * from employees;
- 107 rows selected.
- Execution Plan
- ----------------------------------------------------------
- Plan hash value: 1445457117
- -------------------------------------------------------------------------------
- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
- -------------------------------------------------------------------------------
- | 0 | SELECT STATEMENT | | 107 | 7276 | 3 (0)| 00:00:01 |
- | 1 | TABLE ACCESS FULL| EMPLOYEES | 107 | 7276 | 3 (0)| 00:00:01 |
- -------------------------------------------------------------------------------
- Statistics
- ----------------------------------------------------------
- 1 recursive calls
- 0 db block gets
- 15 consistent gets
- 0 physical reads
- 0 redo size
- 9997 bytes sent via SQL*Net to client
- 569 bytes received via SQL*Net from client
- 9 SQL*Net roundtrips to/from client
- 0 sorts (memory)
- 0 sorts (disk)
- 107 rows processed
SQL> select * from employees;107 rows selected.Execution Plan----------------------------------------------------------Plan hash value: 1445457117-------------------------------------------------------------------------------| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |-------------------------------------------------------------------------------| 0 | SELECT STATEMENT | | 107 | 7276 | 3 (0)| 00:00:01 || 1 | TABLE ACCESS FULL| EMPLOYEES | 107 | 7276 | 3 (0)| 00:00:01 |-------------------------------------------------------------------------------Statistics---------------------------------------------------------- 1 recursive calls 0 db block gets 15 consistent gets 0 physical reads 0 redo size 9997 bytes sent via SQL*Net to client 569 bytes received via SQL*Net from client 9 SQL*Net roundtrips to/from client 0 sorts (memory) 0 sorts (disk) 107 rows processed
让我们再执行一遍
- SQL> select * from employees;
- 107 rows selected.
- Execution Plan
- ----------------------------------------------------------
- Plan hash value: 1445457117
- -------------------------------------------------------------------------------
- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
- -------------------------------------------------------------------------------
- | 0 | SELECT STATEMENT | | 107 | 7276 | 3 (0)| 00:00:01 |
- | 1 | TABLE ACCESS FULL| EMPLOYEES | 107 | 7276 | 3 (0)| 00:00:01 |
- -------------------------------------------------------------------------------
- Statistics
- ----------------------------------------------------------
- 0 recursive calls
- 0 db block gets
- 15 consistent gets
- 0 physical reads
- 0 redo size
- 9997 bytes sent via SQL*Net to client
- 569 bytes received via SQL*Net from client
- 9 SQL*Net roundtrips to/from client
- 0 sorts (memory)
- 0 sorts (disk)
- 107 rows processed
SQL> select * from employees;107 rows selected.Execution Plan----------------------------------------------------------Plan hash value: 1445457117-------------------------------------------------------------------------------| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |-------------------------------------------------------------------------------| 0 | SELECT STATEMENT | | 107 | 7276 | 3 (0)| 00:00:01 || 1 | TABLE ACCESS FULL| EMPLOYEES | 107 | 7276 | 3 (0)| 00:00:01 |-------------------------------------------------------------------------------Statistics---------------------------------------------------------- 0 recursive calls 0 db block gets 15 consistent gets 0 physical reads 0 redo size 9997 bytes sent via SQL*Net to client 569 bytes received via SQL*Net from client 9 SQL*Net roundtrips to/from client 0 sorts (memory) 0 sorts (disk) 107 rows processed
在第一次查询employees时,产生了1次recursive Call,第二次查询的时候,因为数据字典的信息信息已经放在cache里,所以第二次的recursive call 为0. 如果第二次也没有完全cache,那么也是会产生recursive call,但次数比第一次少。
其他的从字面上面就可以看出来了,不需要多解释了吧。
- recursive calls
- recursive calls
- Oracle Recursive Calls 说明
- Oracle Recursive Calls 说明
- 什么时候会发生回调(recursive calls)
- Recursion !!! Recursive calls should not address subproblems that overlap !!!
- 关于执行计划里recursive calls,db block gets和consistent gets参数的解释
- 执行计划里recursive calls,db block gets和consistent gets参数的解释
- recursive
- recursive
- recursive
- linux calls
- outgoing calls and incoming calls
- Recursive function
- tail recursive
- QuickSort (recursive)
- Recursive Fibonacci
- 递归(recursive):
- #ifndef、#def、#endif说明
- ArcMap地图资源链接整理
- Linux进程基础
- Win7如何共享有线网络实现手机上网
- Linux进程关系
- recursive calls
- 学风督导系统苹果端检测总结
- rand函数和srand函数
- SQLDataSource 取得存储过程返回参数
- MySQL事务隔离级别详解
- flex 跨域访问问题
- SetCommState函数失败原因
- cocos2d-iphone-2.0-rc2 API文档在Xcode中查阅显示
- POJ 1017 Packets