DuckLake provides the option to implement all the maintenance functions bundled in the CHECKPOINT statement. This statement will run in order the following DuckLake functions:
ducklake_flush_inlined_dataducklake_expire_snapshotsducklake_merge_adjacent_filesducklake_rewrite_data_filesducklake_cleanup_old_filesducklake_delete_orphaned_files
Usage
The CHECKPOINT statement takes the following global DuckLake options:
rewrite_delete_threshold: A threshold that determines the minimum amount of data that must be removed from a file before a rewrite is warranted (0…1). Used byducklake_rewrite_data_files. Can be scoped globally, per schema, or per table.delete_older_than: How old unused files must be to be removed by theducklake_delete_orphaned_filesandducklake_cleanup_old_filescleanup functions.expire_older_than: How old snapshots must be, by default, to be expired byducklake_expire_snapshots.auto_compact: Whether the compaction functionsducklake_flush_inlined_data,ducklake_merge_adjacent_files,ducklake_rewrite_data_filesandducklake_delete_orphaned_filesrun on a given table. Defaults totrue. Can be scoped globally, per schema, or per table.
If these options are not provided via the ducklake.set_option function, CHECKPOINT will use the default values when applicable and will run a CHECKPOINT of the whole DuckLake.
CHECKPOINT;