21 April 2006
Touch Count Buffer Algorithm : Short explanation
Touch count algorithm was introduced in Oracle 8i, to resolve buffer cache disturbances by large scans. This algorithm makes the blocks earn their right to be at and to stay at the MRU end.
New concept of "touch-count" is introduced, where each buffer has a counter. When the buffer is touched, the counter goes up. Oracle tries to increase the counter only once in every 3 seconds
New concept of "touch-count" is introduced, where each buffer has a counter. When the buffer is touched, the counter goes up. Oracle tries to increase the counter only once in every 3 seconds
- New buffer is placed at the middle of the LRU list
- _db_percent_hot_default % (50 by default)
- When a touch-count>2 (_db_aging_hot_criteria), it is moved to the MRU end
- Server process can move it while looking for a free buffer or
- DBWR can move it while looking for the dirty blocks
- Once moved to the MRU end, the touch-count is reset back to zero
- If the buffer doesn't get used again, it will be moved to the LRU end
- When this happens, one buffer in the middle will switch from the cold to hot zone
- Touch-count for this buffer will be set to 1