Summary
The pg_stat_autovacuum_scores view will contain one row for each table in the current database (including TOAST tables), showing the current autovacuum scores for that specific table. Autovacuum prioritizes tables deemed eligible for processing based on their score, with higher scores indicating higher priority. See autovacuum_priority for more information.
(Description quoted from the official PostgreSQL documentation.)
Columns
The pg_stat_autovacuum_scores statistics view exposes the following columns (names, types and descriptions are taken verbatim from the PostgreSQL documentation):
relidoid
Oid of the table.schemanamename
Name of the schema that the table is in.relnamename
Name of the table.scoredouble precision
Maximum value of all component scores. This is the value that autovacuum would use to sort the list of tables to process.xid_scoredouble precision
Transaction ID age component score. Scores greater than or equal to autovacuum_freeze_score_weight indicate that autovacuum would vacuum the table for transaction ID wraparound prevention.mxid_scoredouble precision
Multixact ID age component score. Scores greater than or equal to autovacuum_multixact_freeze_score_weight indicate that autovacuum would vacuum the table for multixact ID wraparound prevention.vacuum_scoredouble precision
Vacuum component score. Scores greater than or equal to autovacuum_vacuum_score_weight indicate that autovacuum would vacuum the table (unless autovacuum is disabled).vacuum_insert_scoredouble precision
Vacuum insert component score. Scores greater than or equal to autovacuum_vacuum_insert_score_weight indicate that autovacuum would vacuum the table (unless autovacuum is disabled).analyze_scoredouble precision
Analyze component score. Scores greater than or equal to autovacuum_analyze_score_weight indicate that autovacuum would analyze the table (unless autovacuum is disabled).do_vacuumbool
Whether autovacuum would vacuum the table. Note that even if the component scores indicate that autovacuum would vacuum the table, this may be false if autovacuum is disabled.do_analyzebool
Whether autovacuum would analyze the table. Note that even if the component scores indicate that autovacuum would analyze the table, this may be false if autovacuum is disabled.for_wraparoundbool
Whether autovacuum would vacuum the table for wraparound prevention.
Version applicability
Present in PostgreSQL 19 (verified against each release’s documentation). This object was introduced in PostgreSQL 19.
Related & references
Reference: PostgreSQL documentation — pg_stat_autovacuum_scores.