In this recipe, we will be discussing the usage of the
pg_stat_progress_vacuum catalog view, which gives some metrics about the ongoing vacuum process.
PostgreSQL 9.6 introduces a new catalog view, which provides some metrics about the ongoing vacuum processes. This view provides some metrics, along with different action phases, where vacuum/autovacuum performs internally on the table. This view currently does not track the metrics of
VACUUM FULL operations, which might be available in future versions.
VACUUM on any sample big table:
benchmarksql=# VACUUM bigtable;
In another terminal, let us query the view and put in the
\watch mode, as shown here:
benchmarksql=# SELECT * FROM pg_stat_progress_vacuum; ...