Skip to main content

VACUUM DROPPED OBJECTS

Introduced or updated: v1.2.953
ENTERPRISE EDITION FEATURE
VACUUM DROPPED OBJECTS is an Enterprise Edition feature. Contact Databend Support for a license.

Permanently removes eligible dropped objects and reclaims their storage and metadata. This includes dropped tables and, when scanning all databases, dropped databases. Dropped view metadata is also cleaned up. Objects that have been vacuumed cannot be recovered with UNDROP.

To list dropped tables in a database, use SHOW DROP TABLES. To clean history from an active table, use VACUUM TABLE.

Syntax​

VACUUM DROPPED OBJECTS [FROM <database>]
ParameterDescription
FROM <database>Restricts cleanup to the specified database in the current catalog. If omitted, scans all databases in the current catalog, including dropped databases.

With FROM, the command requires SUPER access to the database. Without FROM, it requires global SUPER privilege.

The command does not return a result set.

Retention​

Dropped objects become eligible for cleanup after the retention period configured by data_retention_time_in_days (1 day by default). Removing storage and metadata is permanent.

SET data_retention_time_in_days = 2;
SHOW SETTINGS LIKE 'data_retention_time_in_days';

Metadata Compatibility​

Cleanup can skip tables whose metadata cannot be decoded or whose engine cannot be initialized. It retains their metadata and containing dropped database. Other eligible objects can still be cleaned, but completion does not prove that every object was reclaimed.

For the recognized retired read-only DELTA engine, cleanup can remove dropped-table metadata without deleting external data files. This exception does not apply to arbitrary unknown engines. Retention and other protection rules still apply.

If objects remain, check Meta and Query server logs. Skipping metadata does not repair it. Do not delete skipped metadata or data manually.

VACUUM ALL inherits these rules for its dropped-object cleanup step.

Examples​

Clean up eligible dropped objects from a specific database:

VACUUM DROPPED OBJECTS FROM default;

Clean up eligible dropped objects across all databases in the current catalog:

VACUUM DROPPED OBJECTS;
Try Databend Cloud for FREE

Multimodal, object-storage-native warehouse for BI, vectors, search, and geo.

Snowflake-compatible SQL with automatic scaling.

Sign up and get $200 in credits.

Try it today