Skip to content

vacuum_statistics

Shared-memory table, database, and index statistics for VACUUM activity.

vacuum_statistics · Shared-memory table, database, and index statistics for VACUUM activity.

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
101962vacuum_statisticsvacuum_statistics1.0STATC

Usage

Sources:

vacuum_statistics Shared-memory table, database, and index statistics for VACUUM activity.

Enablement

Merge vacuum_statistics into the existing preload list, restart PostgreSQL, and then create vacuum_statistics in each database that needs its SQL objects:

shared_preload_libraries = 'vacuum_statistics'
CREATE EXTENSION vacuum_statistics;

Core Workflow

The following example is taken from the reviewed upstream documentation. Adapt object names, paths, credentials, and workload values before use.

SELECT relname, tuples_deleted, pages_scanned, pages_removed, total_time
FROM pg_stats_vacuum_tables
ORDER BY total_time DESC
LIMIT 10;

Main Objects

The reviewed install surface includes these prominent objects:

ObjectKindOperational role
extvac_reset_entryFUNCTIONCallable function from the reviewed install surface.
pg_stats_get_vacuum_databaseFUNCTIONCallable function from the reviewed install surface.
pg_stats_get_vacuum_indexesFUNCTIONCallable function from the reviewed install surface.
pg_stats_get_vacuum_tablesFUNCTIONCallable function from the reviewed install surface.
pg_stats_vacuum_databaseVIEWInspection or query view created by the extension.
pg_stats_vacuum_indexesVIEWInspection or query view created by the extension.
pg_stats_vacuum_tablesVIEWInspection or query view created by the extension.
extvac_reset_db_entryFUNCTIONCallable function from the reviewed install surface.

Operations and Boundaries

  • Preloading vacuum_statistics changes cluster startup state; stage configuration and restart changes separately from CREATE EXTENSION.

Table reader