mirror of
https://github.com/postgres/postgres.git
synced 2025-07-09 22:41:56 +03:00
Report index vacuum progress.
This commit adds two columns: indexes_total and indexes_processed, to pg_stat_progress_vacuum system view to show the index vacuum progress. These numbers are reported in the "vacuuming indexes" and "cleaning up indexes" phases. This uses the new parallel message type for progress reporting added by be06506e7. Bump catversion because this changes the definition of pg_stat_progress_vacuum. Author: Sami Imseih Reviewed by: Masahiko Sawada, Michael Paquier, Nathan Bossart, Andres Freund Discussion: https://www.postgresql.org/message-id/flat/5478DFCD-2333-401A-B2F0-0D186AB09228@amazon.com
This commit is contained in:
@ -30,6 +30,7 @@
|
||||
#include "access/table.h"
|
||||
#include "access/xact.h"
|
||||
#include "catalog/index.h"
|
||||
#include "commands/progress.h"
|
||||
#include "commands/vacuum.h"
|
||||
#include "optimizer/paths.h"
|
||||
#include "pgstat.h"
|
||||
@ -631,7 +632,7 @@ parallel_vacuum_process_all_indexes(ParallelVacuumState *pvs, int num_index_scan
|
||||
vacuum));
|
||||
}
|
||||
|
||||
/* Reset the parallel index processing counter */
|
||||
/* Reset the parallel index processing and progress counters */
|
||||
pg_atomic_write_u32(&(pvs->shared->idx), 0);
|
||||
|
||||
/* Setup the shared cost-based vacuum delay and launch workers */
|
||||
@ -902,6 +903,12 @@ parallel_vacuum_process_one_index(ParallelVacuumState *pvs, Relation indrel,
|
||||
pvs->status = PARALLEL_INDVAC_STATUS_COMPLETED;
|
||||
pfree(pvs->indname);
|
||||
pvs->indname = NULL;
|
||||
|
||||
/*
|
||||
* Call the parallel variant of pgstat_progress_incr_param so workers can
|
||||
* report progress of index vacuum to the leader.
|
||||
*/
|
||||
pgstat_progress_parallel_incr_param(PROGRESS_VACUUM_INDEXES_PROCESSED, 1);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user