diff --git a/doc/src/sgml/maintenance.sgml b/doc/src/sgml/maintenance.sgml
index 64bbc831343..652b291de15 100644
--- a/doc/src/sgml/maintenance.sgml
+++ b/doc/src/sgml/maintenance.sgml
@@ -1168,6 +1168,12 @@ analyze threshold = analyze base threshold + analyze scale factor * number of tu
2.0 effectively doubles the
analyze component score.
+
+
+ The
+ pg_stat_autovacuum_scores
+ view shows the current scores of all tables in the current database.
+
diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index 9678877bf3d..08d5b824552 100644
--- a/doc/src/sgml/monitoring.sgml
+++ b/doc/src/sgml/monitoring.sgml
@@ -596,6 +596,16 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
user tables are shown.
+
+ pg_stat_autovacuum_scorespg_stat_autovacuum_scores
+
+ One row for each table in the current database, showing the current
+ autovacuum scores for that specific table. See
+
+ pg_stat_autovacuum_scores for details.
+
+
+
pg_stat_all_indexespg_stat_all_indexes
@@ -4502,6 +4512,175 @@ description | Waiting for a newly initialized WAL file to reach durable storage
+
+ pg_stat_autovacuum_scores
+
+
+ pg_stat_autovacuum_scores
+
+
+
+ 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 for more information.
+
+
+
+ While this view generates its results the same way that autovacuum workers
+ do, it does so using the current source information, which might differ from
+ the source information that an autovacuum worker sees when it gathers its
+ list of tables to process. Therefore, this view is not a completely
+ reliable indicator of which tables autovacuum will process and what order it
+ will process them.
+
+
+
+ pg_stat_autovacuum_scores View
+
+
+
+
+ Column Type
+
+
+ Description
+
+
+
+
+
+
+
+ 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
+ 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
+ indicate
+ that autovacuum would vacuum the table for multixact ID wraparound
+ prevention.
+
+
+
+
+
+ vacuum_scoredouble precision
+
+
+ Vacuum component score. Scores greater than or equal to
+ 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
+ indicate
+ that autovacuum would vacuum the table (unless autovacuum is disabled).
+
+
+
+
+
+ analyze_scoredouble precision
+
+
+ Analyze component score. Scores greater than or equal to
+ 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.
+
+
+
+
+