CHECKPOINT Process
CHECKPOINT Process is a SQL statement in the Transactions category. Writes dirty pages (in-memory changes) to disk. Reduces recovery time on restart. The syntax is CHECKPOINT;. It returns dirty pages written to disk. A typical example: CHECKPOINT; -- Forces all dirty pages for the current database to disk -- PostgreSQL: CHECKPOINT; -- Forces WAL checkpoint -- Automatic checkpoints occur based on: -- SQL Server: recovery interval setting (default 60 seconds) -- PostgreSQL: checkpoint_timeout (default 5 minutes) or max_wal_size -- Manual CHECKPOINT is useful: -- Before a planned shutdown -- After bulk operations -- Before taking a snapshot/backup -- Does NOT affect uncommitted transactions A close relative is BEGIN / START TRANSACTION, which begins a new transaction. Changes made within are invisible to others until COMMIT. A close relative is COMMIT, which saves all changes made in the current transaction permanently. A close relative is ROLLBACK, which undoes all changes made in the current transaction (or to a savepoint).