Transaction Management: ------------------------ IN MEMORY =================== Transaction Table (TT) Ti, LSNi (last log entry for Ti) Dirty Page Table (DPT) Py LSNy (first log entry that changed Py that is not recorded to disk) Log: LSN log record ON DISK: ================= Data page: Py LSNy: LSN of the last update Log: Part of the log written to disk WAL: Write ahead logging: The log is always ahead of the data: If you are going to write a data page to disk, then flush the log to disk first. and then write the data page to disk ~~~~~~~~~~~~~~~~~~~~~~~~~~ Log Entries =============================== LSN: Log sequence number LSN Ti updates Pi old_value new_value PREV_LSN LSN Ti commit PREV_LSN LSN Ti abort PREV_LSN LSN Ti end PREV_LSN LSN undo (Ti updates Pi old_value new_value) Checkpoints LSN BEGIN CHECKPOINT LSN dump of TT LSN dump of DPT LSN END CHECKPOINT