You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Report indexes being vacuumed in pg_stat_progress_vacuum
Previously, during the "vacuuming indexes" and "cleaning up
indexes" phases, pg_stat_progress_vacuum reported how many
indexes had been processed but not which index was being
processed. On a table with many indexes, especially indexes of
different types, this made it hard to tell which index a slow or
stuck vacuum was working on.
This commit adds two columns to pg_stat_progress_vacuum,
index_vacuum_pids and index_vacuum_oids. Each process, the leader
and any parallel workers, reports the OID of the index it is
currently processing into its own progress array slot. The view
gathers these onto the leader's row as two arrays that are
aligned by position, so that unnest(index_vacuum_pids,
index_vacuum_oids) gives the (pid, index) pairs. For a serial
vacuum each array holds a single value, and both are null when no
index is being processed.
Because pg_stat_progress_vacuum reports one row per command, the
per-worker information is aggregated onto the leader's row rather
than shown as separate rows. This needs no new shared memory,
since the per-process progress array slots already exist.
Author: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Reviewed-by: Sami Imseih <samimseih@gmail.com>
Reviewed-by: Satyanarayana Narlapuram <satyanarlapuram@gmail.com>
Discussion: https://postgr.es/m/CALj2ACUgwSchK6jQ2CdKLBWUADTOE_zKdTff2Zg3E6hOuXKv-w@mail.gmail.com
0 commit comments