Skip to contents

Runs all maintenance operations on the DuckLake catalog: flushes inlined data, expires old snapshots, merges small files, and cleans up unreferenced files.

Usage

checkpoint_ducklake(ducklake_name = NULL)

Arguments

ducklake_name

Name of the attached DuckLake catalog. If NULL, the current database is used.

Value

Invisibly returns NULL.

Details

CHECKPOINT is the recommended one-stop maintenance command. It internally calls flush_inlined_data() along with compaction, snapshot expiration, and file cleanup.

Run checkpoints periodically (e.g., after a batch of streaming inserts) to consolidate inlined data and keep query performance optimal.

Note

On Windows with a DuckDB-file catalog, the file-cleanup step of CHECKPOINT can fail because Windows does not allow the catalog file to be opened a second time while the lake is attached (a current DuckDB limitation). flush_inlined_data() is unaffected; on Windows, prefer it for routine use and run full checkpoints from a fresh session, or use a PostgreSQL/SQLite catalog.

Examples

if (FALSE) { # \dontrun{
# Run all maintenance
checkpoint_ducklake()

# Or specify a named lake
checkpoint_ducklake("my_lake")
} # }