The Oracle (tm) Users' Co-Operative FAQ

How are the Cache Buffers Chains and Cache Buffers LRU Chains used in the Buffer Cache management ?


Author's name: Jonathan Lewis

Author's Email: Jonathan@jlcomp.demon.co.uk

Date written: 15th Dec 2002

Oracle version(s): 8.1 - 9.0

How are the Cache Buffers Chains and Cache Buffers LRU Chains used in the Buffer Cache management ?

Back to index of questions


The Cache Buffers Chains are very short chains (linked lists) that allow Oracle to locate a block very quickly if it is in the buffer. Each block hashes (by block address, tablespace number, and block type - I believe) to one of the chains. In Oracle 8 there are roughly twice as many chains available as there are buffers, so many chains are empty, and the remainder tend to have only one or two blocks in them - so scanning a chain can be very quick.

Chains are covered by Cache Buffers Chains latches. Each Cache Buffers Chains latch covers around 64 - 128 chains - the commonest sizes of db_block_buffers (or db_cache_size as it should be in oracle 9) mean that are typically 512 or 1024 chains, but this varies in powers of 2 as the size of the buffer cache grows.

The Cache Buffers LRU chains tell Oracle about how much use a buffer has had, and therefore allow it to decide quickly and cheaply which buffer to clear when someone wants to read a new block from disc. In fact the term LRU chain is somewhat obsolete, as Oracle 8.1 uses a touch count algorithm to decide on the popularity of a buffered block, nevertheless many details of the LRU algorithm still apply, and the chain of buffers still has blocks being 'pushed down' to be dropped off at the end if they have not been touched in the recent past.

 


Further reading: N/A


Back to top

Back to index of questions