Choosing a page-stealing algorithm

When DB2® must remove a page from the buffer pool to make room for a newer page, the action is called stealing the page from the buffer pool.

About this task

By default, DB2 uses a least-recently-used (LRU) algorithm for managing pages in storage. This algorithm removes pages that have not been recently used and retains recently used pages in the buffer pool. However, DB2 can use different page-stealing algorithms to manage buffer pools more efficiently.

Procedure

To specify the page-stealing algorithm:

  1. Determine which page-stealing algorithm is the most efficient for the buffer pool.
    Option Description
    PGSTEAL(LRU)

    Use this option in most cases. DB2 uses a "least recently used" algorithm to determine when to make buffer pool pages available for stealing.

    This option keeps pages in the buffer pool that are being used frequently and removes unused pages. It ensures that the most frequently accessed pages are always in the buffer pool.

    This option has extra costs for LRU chain maintenance and might cause extra latch contention.

    PGSTEAL(FIFO) DB2 uses a "first in first out" algorithm to determine when to make buffer pool pages available for stealing.

    This option removes the oldest pages in the buffer pool, no matter how frequently they are referenced. This approach to page stealing reduces the cost of determining which pages can be removed, and reduces internal latch contention which result from the LRU algorithm.

    Specify this option for buffer pools that have no I/O, that is buffer pools that have table space or index entries that always remain in memory.

    Start of changeStart of changePGSTEAL(NONE)End of changeEnd of change Start of changeDB2 pre-loads the pages into the buffer pool when an object is opened and tries to keep all pages for an object resident in the buffer pool while the object is open. If the buffer pool in not large enough to contain all of the objects, DB2 uses the FIFO algorithm to manage the page stealing.End of change
  2. Issue an ALTER BUFFERPOOL command, and specify the PGSTEAL option.