pg_stat_autovacuum_scores — PostgreSQL statistics view

The PostgreSQL pg_stat_autovacuum_scores statistics view: full column reference (names, types, descriptions), catalog relationships and version support.

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):

  • relid oid
    Oid of the table.
  • schemaname name
    Name of the schema that the table is in.
  • relname name
    Name of the table.
  • score double precision
    Maximum value of all component scores. This is the value that autovacuum would use to sort the list of tables to process.
  • xid_score double 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_score double 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_score double 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_score double 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_score double 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_vacuum bool
    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_analyze bool
    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_wraparound bool
    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.