Parent and child cursors in the library cache

refer: http://www.ixora.com.au/q+a/0104/19005414.htm

 

From:Steve Adams
Date:19-Apr-2001 00:54
Subject:  Parent and child cursors in the library cache

Firstly, please review the answer What are versions of an SQL statement?.

For each SQL statement the library cache contains a "parent" cursor for the text of the SQL statement. The parent cursor is comprised of a "handle" that can be looked up by hash value via the library cache hash table, and an "object" that contains pointers to each of its "child" cursors. Each child cursor is also comprised of a handle and an object. The child object is comprised of two heaps numbered 0 and 6. Heap 0 contains all the identifying information for a particular version of the SQL statement and heap 6 contains the execution plan. This distinction between parent and child cursors is maintained even when there is only one version of each SQL statement.

For parent cursors the convention used in the X$ tables is that the parent address is the same as the handle address. V$OPEN_CURSORS, V$SQL and so on are only interested in child cursors and so they exclude parent cursors by requiring that the two addresses are different. The columns that you mentioned are of course the two addresses.

 

I'm trying to play with X$KGLLK fixed table. But I can't understand the difference between the columns KGLLKHDL and KGLHDPAR. I've found in the view definition V$OPEN_CURSOR that to get the cursor list, Oracle selects rows where KGLLKHDL <> KGLHDPAR. But if I query all rows for particular transaction I can see 2 rows for the same cursor - first row with KGLLKHDL=KGLHDPAR and second row with KGLLKHDL <> KGLHDPAR.

 

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值