首页 » ORACLE 9i-23ai » Shouldn’t we have waited for buffer busy waits while waiting CBC latch?

Shouldn’t we have waited for buffer busy waits while waiting CBC latch?

With regular logical  IOs the buffer contents are not read while holding the CBC(Cache Buffer Chian) latch:

  1.  1#  Take CBC latch into shared mode
  2.  2# Walk the buffer hash chain until you find the relevant buffer header
  3.  3# Upgrade the CBC latch to Exclusive mode
  4.  4# Pin the buffer header
  5.  5 # Release the CBC latch
  6.  6 # Now access the buffer data( call transaction,  data layer etc)   — if someone else wants to pin the buffer now , they’d wait for buffer busy waits
  7.  7# Take the CBC latch again(in shared mode)
  8.  8$ Unpin the buffer header
  9.  10# Release the CBC latch

Sometimes “short” logical IOs can skip a few steps

with “short” LIOs like unique index lookup LIO(etc) Oracle can avoid the buffer pinning codepath:

  1.  1# Take CBC altch in shared mode
  2.  2# Walk the buffer hash chain until you find the relevant buffer header — This show up as consistent reads – examination  conter in v$sesstat
  3.  3# Now access the buffer data
  4.  4# Release the CBC latch

 

from TanelPoder’s

打赏

对不起,这篇文章暂时关闭评论。