summaryrefslogtreecommitdiff
path: root/src/include/commands/progress.h
diff options
context:
space:
mode:
authorRobert Haas2019-03-25 14:59:04 +0000
committerRobert Haas2019-03-25 14:59:04 +0000
commit6f97457e0ddd8b421ca5e483439ef0318e6fc89a (patch)
tree9d520dd37b2affbf242b7f8db69eacf0044b225a /src/include/commands/progress.h
parent1d88a75c424664cc85f307a876cde85191d27272 (diff)
Add progress reporting for CLUSTER and VACUUM FULL.
This uses the same progress reporting infrastructure added in commit c16dc1aca5e01e6acaadfcf38f5fc964a381dc62 and extends it to these additional cases. We lack the ability to track the internal progress of sorts and index builds so the information reported is coarse-grained for some parts of the operation, but it still seems like a significant improvement over having nothing at all. Tatsuro Yamada, reviewed by Thomas Munro, Masahiko Sawada, Michael Paquier, Jeff Janes, Alvaro Herrera, Rafia Sabih, and by me. A fair amount of polishing also by me. Discussion: http://postgr.es/m/59A77072.3090401@lab.ntt.co.jp
Diffstat (limited to 'src/include/commands/progress.h')
-rw-r--r--src/include/commands/progress.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/include/commands/progress.h b/src/include/commands/progress.h
index 9858b36a383..04542d9e923 100644
--- a/src/include/commands/progress.h
+++ b/src/include/commands/progress.h
@@ -34,4 +34,27 @@
#define PROGRESS_VACUUM_PHASE_TRUNCATE 5
#define PROGRESS_VACUUM_PHASE_FINAL_CLEANUP 6
+/* Progress parameters for cluster */
+#define PROGRESS_CLUSTER_COMMAND 0
+#define PROGRESS_CLUSTER_PHASE 1
+#define PROGRESS_CLUSTER_INDEX_RELID 2
+#define PROGRESS_CLUSTER_HEAP_TUPLES_SCANNED 3
+#define PROGRESS_CLUSTER_HEAP_TUPLES_WRITTEN 4
+#define PROGRESS_CLUSTER_TOTAL_HEAP_BLKS 5
+#define PROGRESS_CLUSTER_HEAP_BLKS_SCANNED 6
+#define PROGRESS_CLUSTER_INDEX_REBUILD_COUNT 7
+
+/* Phases of cluster (as dvertised via PROGRESS_CLUSTER_PHASE) */
+#define PROGRESS_CLUSTER_PHASE_SEQ_SCAN_HEAP 1
+#define PROGRESS_CLUSTER_PHASE_INDEX_SCAN_HEAP 2
+#define PROGRESS_CLUSTER_PHASE_SORT_TUPLES 3
+#define PROGRESS_CLUSTER_PHASE_WRITE_NEW_HEAP 4
+#define PROGRESS_CLUSTER_PHASE_SWAP_REL_FILES 5
+#define PROGRESS_CLUSTER_PHASE_REBUILD_INDEX 6
+#define PROGRESS_CLUSTER_PHASE_FINAL_CLEANUP 7
+
+/* Commands of PROGRESS_CLUSTER */
+#define PROGRESS_CLUSTER_COMMAND_CLUSTER 1
+#define PROGRESS_CLUSTER_COMMAND_VACUUM_FULL 2
+
#endif