Skip to main content

VACUUM ALL

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

Runs the following cleanup operations in order:

  1. VACUUM TABLES: Cleans eligible history from writable FUSE tables across non-system databases in the current catalog.
  2. VACUUM DROPPED OBJECTS: Cleans eligible dropped objects across databases in the current catalog, including dropped databases.
  3. VACUUM TEMPORARY FILES: Cleans the tenant's temporary spill files and inactive temporary-table sessions using the default retention and no explicit limit.

Each step follows its own retention and protection rules. Current data in active tables is preserved; cleaned history and dropped objects cannot be recovered. Temporary spill-file retention is separate from data_retention_time_in_days.

Syntax

VACUUM ALL

Requires global SUPER privilege. There is no database filter or command option. The command does not return a result set.

A failure that propagates from one step stops execution before the following steps. Per-table errors handled by batch cleanup retain the behavior described in VACUUM TABLES. Cleanup already completed is not rolled back.

Example

VACUUM ALL;
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