⌘+k ctrl+k
1.2.0 (stable)
Search Shortcut cmd + k | ctrl + k
VACUUM Statement

The VACUUM statement only has basic support in DuckDB and is mostly provided for PostgreSQL-compatibility.

Some variants of it, such as when calling for a given column, recompute the distinct statistics (the amount if distinct entities) if they have become stale due to updates.

Warning The behavior of VACUUM is not consistent with PostgreSQL semantics and it is likely going to change in the future.

Examples

No-op:

VACUUM;

No-op:

VACUUM ANALYZE;

Calling VACUUM on a given table-column pair rebuilds statistics for the table and column:

VACUUM my_table(my_column);

Rebuild statistics for the table and column:

VACUUM ANALYZE my_table(my_column);

The following operation is not supported:

VACUUM FULL;
Not implemented Error:
Full vacuum option

Reclaiming Space

The VACUUM statement does not reclaim space. For instruction on reclaiming space, refer to the “Reclaiming space” page.

Syntax