From cfbf50c85ae9bfdfb9167dab446bf3256e33ddb1 Mon Sep 17 00:00:00 2001 From: Alena Rybakina Date: Thu, 19 Dec 2024 12:57:49 +0300 Subject: [PATCH 5/5] Add documentation about the system views that are used in the machinery of vacuum statistics. --- doc/src/sgml/system-views.sgml | 755 +++++++++++++++++++++++++++++++++ 1 file changed, 755 insertions(+) diff --git a/doc/src/sgml/system-views.sgml b/doc/src/sgml/system-views.sgml index 162c76b729a..50578cae90d 100644 --- a/doc/src/sgml/system-views.sgml +++ b/doc/src/sgml/system-views.sgml @@ -5654,4 +5654,759 @@ SELECT * FROM pg_locks pl LEFT JOIN pg_prepared_xacts ppx + + <structname>pg_stat_vacuum_database</structname> + + + pg_stat_vacuum_database + + + + The view pg_stat_vacuum_database will contain + one row for each database in the current cluster, showing statistics about + vacuuming that database. + + + + <structname>pg_stat_vacuum_database</structname> Columns + + + + + Column Type + + + Description + + + + + + + + dbid oid + + + OID of a database + + + + + + total_blks_read int8 + + + Number of database blocks read by vacuum operations + performed on this database + + + + + + total_blks_hit int8 + + + Number of times database blocks were found in the + buffer cache by vacuum operations + performed on this database + + + + + + total_blks_dirtied int8 + + + Number of database blocks dirtied by vacuum operations + performed on this database + + + + + + total_blks_written int8 + + + Number of database blocks written by vacuum operations + performed on this database + + + + + + wal_records int8 + + + Total number of WAL records generated by vacuum operations + performed on this database + + + + + + wal_fpi int8 + + + Total number of WAL full page images generated by vacuum operations + performed on this database + + + + + + wal_bytes numeric + + + Total amount of WAL bytes generated by vacuum operations + performed on this database + + + + + + blk_read_time float8 + + + Time spent reading database blocks by vacuum operations performed on + this database, in milliseconds (if is enabled, + otherwise zero) + + + + + + blk_write_time float8 + + + Time spent writing database blocks by vacuum operations performed on + this database, in milliseconds (if is enabled, + otherwise zero) + + + + + + delay_time float8 + + + Time spent sleeping in a vacuum delay point by vacuum operations performed on + this database, in milliseconds (see + for details) + + + + + + system_time float8 + + + System CPU time of vacuuming this database, in milliseconds + + + + + + user_time float8 + + + User CPU time of vacuuming this database, in milliseconds + + + + + + total_time float8 + + + Total time of vacuuming this database, in milliseconds + + + + + + wraparound_failsafe_count int4 + + + Number of times the vacuum was run to prevent a wraparound problem. + + + + + + errors int4 + + + Number of times vacuum operations performed on this database + were interrupted on any errors + + + + +
+
+ + + <structname>pg_stat_vacuum_indexes</structname> + + + pg_stat_vacuum_indexes + + + + The view pg_stat_vacuum_indexes will contain + one row for each index in the current database (including TOAST + table indexes), showing statistics about vacuuming that specific index. + + + + <structname>pg_stat_vacuum_indexes</structname> Columns + + + + + Column Type + + + Description + + + + + + + + relid oid + + + OID of an index + + + + + + schema name + + + Name of the schema this index is in + + + + + + relname name + + + Name of this index + + + + + + total_blks_read int8 + + + Number of database blocks read by vacuum operations + performed on this index + + + + + + total_blks_hit int8 + + + Number of times database blocks were found in the + buffer cache by vacuum operations + performed on this index + + + + + + total_blks_dirtied int8 + + + Number of database blocks dirtied by vacuum operations + performed on this index + + + + + + total_blks_written int8 + + + Number of database blocks written by vacuum operations + performed on this index + + + + + + rel_blks_read int8 + + + Number of blocks vacuum operations read from this + index + + + + + + rel_blks_hit int8 + + + Number of times blocks of this index were already found + in the buffer cache by vacuum operations, so that a read was not necessary + (this only includes hits in the + project; buffer cache, not the operating system's file system cache) + + + + + + pages_deleted int8 + + + Number of pages deleted by vacuum operations + performed on this index + + + + + + tuples_deleted int8 + + + Number of dead tuples vacuum operations deleted from this index + + + + + + wal_records int8 + + + Total number of WAL records generated by vacuum operations + performed on this index + + + + + + wal_fpi int8 + + + Total number of WAL full page images generated by vacuum operations + performed on this index + + + + + + wal_bytes numeric + + + Total amount of WAL bytes generated by vacuum operations + performed on this index + + + + + + blk_read_time int8 + + + Time spent reading database blocks by vacuum operations performed on + this index, in milliseconds (if is enabled, + otherwise zero) + + + + + + blk_write_time int8 + + + Time spent writing database blocks by vacuum operations performed on + this index, in milliseconds (if is enabled, + otherwise zero) + + + + + + delay_time float8 + + + Time spent sleeping in a vacuum delay point by vacuum operations performed on + this index, in milliseconds (see + for details) + + + + + + system_time float8 + + + System CPU time of vacuuming this index, in milliseconds + + + + + + user_time float8 + + + User CPU time of vacuuming this index, in milliseconds + + + + + + total_time float8 + + + Total time of vacuuming this index, in milliseconds + + + + + +
+
+ + + <structname>pg_stat_vacuum_tables</structname> + + + pg_stat_vacuum_tables + + + + The view pg_stat_vacuum_tables will contain + one row for each table in the current database (including TOAST + tables), showing statistics about vacuuming that specific table. + + + + <structname>pg_stat_vacuum_tables</structname> Columns + + + + + Column Type + + + Description + + + + + + + + relid oid + + + OID of a table + + + + + + schema name + + + Name of the schema this table is in + + + + + + relname name + + + Name of this table + + + + + + total_blks_read int8 + + + Number of database blocks read by vacuum operations + performed on this table + + + + + + total_blks_hit int8 + + + Number of times database blocks were found in the + buffer cache by vacuum operations + performed on this table + + + + + + total_blks_dirtied int8 + + + Number of blocks written directly by vacuum or auto vacuum. + Blocks that are dirtied by a vacuum process can be written out by another process. + + + + + + total_blks_written int8 + + + Number of database blocks written by vacuum operations + performed on this table + + + + + + rel_blks_read int8 + + + Number of blocks vacuum operations read from this + table + + + + + + rel_blks_hit int8 + + + Number of times blocks of this table were already found + in the buffer cache by vacuum operations, so that a read was not necessary + (this only includes hits in the + project; buffer cache, not the operating system's file system cache) + + + + + + pages_scanned int8 + + + Number of pages examined by vacuum operations + performed on this table + + + + + + pages_removed int8 + + + Number of pages removed from the physical storage by vacuum operations + performed on this table + + + + + + vm_new_frozen_pages int8 + + + Number of the number of pages newly set all-frozen by vacuum + in the visibility map. + + + + + + vm_new_visible_pages int8 + + + Number of the number of pages newly set all-visible by vacuum + in the visibility map. + + + + + + vm_new_visible_frozen_pages int8 + + + Number of the number of pages newly set all-visible and all-frozen + by vacuum in the visibility map. + + + + + + tuples_deleted int8 + + + Number of dead tuples vacuum operations deleted from this table + + + + + + tuples_frozen int8 + + + Number of tuples of this table that vacuum operations marked as + frozen + + + + + + recently_dead_tuples int8 + + + Number of dead tuples vacuum operations left in this table due + to their visibility in transactions + + + + + + missed_dead_tuples int8 + + + Number of fully DEAD (not just RECENTLY_DEAD) tuples that could not be + pruned due to failure to acquire a cleanup lock on a heap page. + + + + + + index_vacuum_count int8 + + + Number of times indexes on this table were vacuumed + + + + + + wraparound_failsafe_count int4 + + + Number of times the vacuum was run to prevent a wraparound problem. + + + + + + missed_dead_pages int8 + + + Number of pages that had at least one missed_dead_tuples. + + + + + + wal_records int8 + + + Total number of WAL records generated by vacuum operations + performed on this table + + + + + + wal_fpi int8 + + + Total number of WAL full page images generated by vacuum operations + performed on this table + + + + + + wal_bytes numeric + + + Total amount of WAL bytes generated by vacuum operations + performed on this table + + + + + + blk_read_time int8 + + + Time spent reading database blocks by vacuum operations performed on + this table, in milliseconds (if is enabled, + otherwise zero) + + + + + + blk_write_time int8 + + + Time spent writing database blocks by vacuum operations performed on + this table, in milliseconds (if is enabled, + otherwise zero) + + + + + + delay_time float8 + + + Time spent sleeping in a vacuum delay point by vacuum operations performed on + this table, in milliseconds (see + for details) + + + + + + system_time float8 + + + System CPU time of vacuuming this table, in milliseconds + + + + + + user_time float8 + + + User CPU time of vacuuming this table, in milliseconds + + + + + + total_time float8 + + + Total time of vacuuming this table, in milliseconds + + + + + +
+ Columns total_*, wal_* + and blk_* include data on vacuuming indexes on this table, while columns + system_time and user_time only include data + on vacuuming the heap. +
-- 2.39.5 (Apple Git-154)