Skip to main content

VACUUM TABLES

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

Reclaims storage by running VACUUM TABLE cleanup on writable FUSE tables in one database or across databases in the current catalog. It preserves current table data and follows the same retention and snapshot-tag protection rules as single-table cleanup.

Syntax

VACUUM TABLES [FROM <database>]
ScopeBehaviorRequired privilege
FROM <database>Cleans eligible tables in the specified database.SUPER access to that database
No FROM clauseCleans eligible tables in all non-system databases in the current catalog, not just the current database.Global SUPER

Non-FUSE tables and read-only tables are skipped. Ordinary per-table cleanup errors are logged and processing continues with other tables. Cancellation stops the operation; errors listing databases or tables can also stop it. Completion does not guarantee that every table was cleaned successfully.

The command does not return a result set. It does not clean dropped objects or temporary files; use VACUUM ALL to include those operations.

Examples

VACUUM TABLES FROM default;

To clean eligible tables across all non-system databases in the current catalog:

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