SQLite PRAGMA

PRAGMA incremental_vacuum

The incremental_vacuum pragma causes up to N pages to be removed from the freelist.

PRAGMA schema.incremental_vacuum(N);
PRAGMA schema.incremental_vacuum;

On the sample database

PRAGMA incremental_vacuum returns no rows in SQLite 3.54.1 (sql.js).

What the SQLite documentation says

The incremental_vacuum pragma causes up to N pages to be removed from the freelist. The database file is truncated by the same amount. The incremental_vacuum pragma has no effect if the database is not in auto_vacuum=incremental mode or if there are no pages on the freelist. If there are fewer than N pages on the freelist, or if N is less than 1, or if the "(N)" argument is omitted, then the entire freelist is cleared.

From sqlite.org's pragma documentation for SQLite 3.54.1, in the public domain.

← ignore_check_constraints · index_info →