From 03f9e5cba0ee1633af4abe734504df50af46fbd8 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Sun, 7 Apr 2019 11:30:14 +0200 Subject: Report progress of REINDEX operations This uses the same infrastructure that the CREATE INDEX progress reporting uses. Add a column to pg_stat_progress_create_index to report the OID of the index being worked on. This was not necessary for CREATE INDEX, but it's useful for REINDEX. Also edit the phase descriptions a bit to be more consistent with the source code comments. Discussion: https://www.postgresql.org/message-id/ef6a6757-c36a-9e81-123f-13b19e36b7d7%402ndquadrant.com --- src/include/commands/progress.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/include/commands/progress.h') diff --git a/src/include/commands/progress.h b/src/include/commands/progress.h index f046fa13b18..37043e926d1 100644 --- a/src/include/commands/progress.h +++ b/src/include/commands/progress.h @@ -59,6 +59,7 @@ /* Progress parameters for CREATE INDEX */ /* 3, 4 and 5 reserved for "waitfor" metrics */ +#define PROGRESS_CREATEIDX_INDEX_OID 6 #define PROGRESS_CREATEIDX_ACCESS_METHOD_OID 8 #define PROGRESS_CREATEIDX_PHASE 9 /* AM-agnostic phase # */ #define PROGRESS_CREATEIDX_SUBPHASE 10 /* phase # filled by AM */ @@ -76,6 +77,8 @@ #define PROGRESS_CREATEIDX_PHASE_VALIDATE_SORT 5 #define PROGRESS_CREATEIDX_PHASE_VALIDATE_TABLESCAN 6 #define PROGRESS_CREATEIDX_PHASE_WAIT_3 7 +#define PROGRESS_CREATEIDX_PHASE_WAIT_4 8 +#define PROGRESS_CREATEIDX_PHASE_WAIT_5 9 /* * Subphases of CREATE INDEX, for index_build. -- cgit v1.2.3