Enterprise job type:
cleanup. Distinct from compact: compaction
merges files, cleanup removes them. optimize() in LanceDB Embedded runs both in one call;
Enterprise schedules them as separate jobs, and runs cleanup only when the
deployment’s configuration enables it.Retention
cleanup_older_than defaults to 7 days. Versions older than that are
removed, along with the files only they referenced. In LanceDB Enterprise, the
retention period comes from its configuration instead.
The latest version is never removed, whatever you pass. timedelta(0) makes
every older version eligible for removal, but cleanup still keeps tagged
versions, as the warning below describes.
Managed blob objects
Managed blobs store out-of-line payloads under the table’s_blobs/ directory. Cleanup follows the references from
retained snapshots, including protected tags, before selecting
objects for deletion. Replacing a blob or deleting a row makes its old payload
eligible only after no retained snapshot references it.
Cleanup removes whole objects. If a packed object contains several blobs, it
remains while any of them is live. Compaction preserves Managed payload objects
rather than copying their bytes, so compaction alone does not reclaim the
unused portion of a packed object.
Use table maintenance to remove Managed objects; deleting _blobs/ files
directly can corrupt current or historical snapshots. Upgrade all clients and
maintenance workers to a version that understands Managed blobs before using
them, and reopen handles created before that upgrade.
For LanceDB Embedded tables, optimize() performs compaction and cleanup.
Enterprise runs these as background jobs; Python tables connected to Enterprise
do not support optimize().
See Intelligent Auto-Maintenance for the Enterprise path.
Disk usage does not drop immediately
Compaction writes new, merged files before the old ones are removed, so disk usage can rise before it falls. Space is reclaimed only when cleanup prunes the versions that referenced the superseded files. If you need to reclaim space aggressively in the embedded library, shorten the retention window rather than waiting for the default:Files from failed transactions
A write that fails partway can leave files that look like an operation still in progress. Cleanup will not remove them until they are at least seven days old, because it cannot tell them apart from a live write.optimize() in the embedded library. A deployment’s
cleanup jobs never set it.
What to read next
Compaction
Merging small files, the other half of
optimize().Intelligent Auto-Maintenance
How Enterprise decides to run cleanup without a call from you.