Skip to main content

VACUUM DROPPED OBJECTS

Introduced or updated: v1.2.940
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';

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