The DBMS can almost always manage memory better than the OS.

<aside> 💡 Two types of contol we care about

  1. Spatial Control
  2. Temporal Contorl </aside>

1. Buffer Pool Manager


Memory region organized as an array of fixed-size pages.

An array entry is called a frame.

When the DBMS requests a page, an exact copy is placed into one of these frames.

1.1 Metadata

The page table keeps track of pages that are currently in memory.

Also maintains additional meta-data per page:

Untitled

1.2 Locks & Latches

<aside> 💡 Locks

<aside> 💡 Latches

Locks Latches
Separate … User Transaction Threads
Protect … Database Contents In-Memory Data Structures
During … Entire Txns Critical Sections
Modes … S, X, Update, Intention R, W
Deadlock Detection & Resolution Avoidance
… by … Waits-fir, Timeout, Aborts Coding Discipline
Kept in … Lock Manager Protected Data Structure

1.3 Page Directory & Page Table

1.4 Optimizations

  1. Global Policies:

    Make decisions for all active txns.

  2. Local Policies

    Allocate frames to a specific txn without considering the behavior of concurrent txns. Still need to support sharing pages.

1.4.1 Multiple Buffer Pools

The DBMS not always have a single buffer pool for the entire system