CSE Roadmap

Common tier · about 2 hours · 5 parts

Part 3 of 5 · 1 min read

What a checkpoint records

A checkpoint records that all dirty pages as of that moment have been flushed, giving recovery a safe, recent starting point.

Think of a diary keeper periodically writing "everything up through this page has been fully copied into the permanent archive," so a later reconstruction only ever needs to start from the most recent such note.

In plain words: a checkpoint is a periodic operation where the database flushes every dirty page in the buffer pool, covered in Level 4, to disk, then writes a special log entry recording that this flush happened. After a crash, recovery only needs to consider log entries from the most recent checkpoint onward, since everything before that checkpoint is already guaranteed to be safely reflected on disk, with no redo needed for anything older. This directly bounds how far back recovery ever needs to look, regardless of how long the database has been running.

A worked example. A checkpoint taken at noon flushes every currently dirty page to disk and records that fact in the log; a crash at 1pm only requires recovery to replay log entries from noon onward, not from the database's entire history.

The key lines. No new SQL; checkpointing is an automatic background process the database performs on its own schedule.

Checkpoint

A checkpoint flushes every dirty page in the buffer pool to disk and records that fact in the log, giving crash recovery a safe, recent starting point so it never needs to replay further back than the most recent checkpoint.

Example: a diary keeper's periodic note that everything up through a certain page has been fully archived mirrors a checkpoint's recovery starting point.