@@ -400,6 +400,14 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
400
400
</entry>
401
401
</row>
402
402
403
+ <row>
404
+ <entry><structname>pg_stat_progress_repack</structname><indexterm><primary>pg_stat_progress_repack</primary></indexterm></entry>
405
+ <entry>One row for each backend running
406
+ <command>REPACK</command>, showing current progress. See
407
+ <xref linkend="repack-progress-reporting"/>.
408
+ </entry>
409
+ </row>
410
+
403
411
<row>
404
412
<entry><structname>pg_stat_progress_basebackup</structname><indexterm><primary>pg_stat_progress_basebackup</primary></indexterm></entry>
405
413
<entry>One row for each WAL sender process streaming a base backup,
@@ -5943,6 +5951,228 @@ FROM pg_stat_get_backend_idset() AS backendid;
5943
5951
</table>
5944
5952
</sect2>
5945
5953
5954
+ <sect2 id="repack-progress-reporting">
5955
+ <title>REPACK Progress Reporting</title>
5956
+
5957
+ <indexterm>
5958
+ <primary>pg_stat_progress_repack</primary>
5959
+ </indexterm>
5960
+
5961
+ <para>
5962
+ Whenever <command>REPACK</command> is running,
5963
+ the <structname>pg_stat_progress_repack</structname> view will contain a
5964
+ row for each backend that is currently running the command. The tables
5965
+ below describe the information that will be reported and provide
5966
+ information about how to interpret it.
5967
+ </para>
5968
+
5969
+ <table id="pg-stat-progress-repack-view" xreflabel="pg_stat_progress_repack">
5970
+ <title><structname>pg_stat_progress_repack</structname> View</title>
5971
+ <tgroup cols="1">
5972
+ <thead>
5973
+ <row>
5974
+ <entry role="catalog_table_entry"><para role="column_definition">
5975
+ Column Type
5976
+ </para>
5977
+ <para>
5978
+ Description
5979
+ </para></entry>
5980
+ </row>
5981
+ </thead>
5982
+
5983
+ <tbody>
5984
+ <row>
5985
+ <entry role="catalog_table_entry"><para role="column_definition">
5986
+ <structfield>pid</structfield> <type>integer</type>
5987
+ </para>
5988
+ <para>
5989
+ Process ID of backend.
5990
+ </para></entry>
5991
+ </row>
5992
+
5993
+ <row>
5994
+ <entry role="catalog_table_entry"><para role="column_definition">
5995
+ <structfield>datid</structfield> <type>oid</type>
5996
+ </para>
5997
+ <para>
5998
+ OID of the database to which this backend is connected.
5999
+ </para></entry>
6000
+ </row>
6001
+
6002
+ <row>
6003
+ <entry role="catalog_table_entry"><para role="column_definition">
6004
+ <structfield>datname</structfield> <type>name</type>
6005
+ </para>
6006
+ <para>
6007
+ Name of the database to which this backend is connected.
6008
+ </para></entry>
6009
+ </row>
6010
+
6011
+ <row>
6012
+ <entry role="catalog_table_entry"><para role="column_definition">
6013
+ <structfield>relid</structfield> <type>oid</type>
6014
+ </para>
6015
+ <para>
6016
+ OID of the table being repacked.
6017
+ </para></entry>
6018
+ </row>
6019
+
6020
+ <row>
6021
+ <entry role="catalog_table_entry"><para role="column_definition">
6022
+ <structfield>command</structfield> <type>text</type>
6023
+ </para>
6024
+ <para>
6025
+ The command that is running. Currently, the only value
6026
+ is <literal>REPACK</literal>.
6027
+ </para></entry>
6028
+ </row>
6029
+
6030
+ <row>
6031
+ <entry role="catalog_table_entry"><para role="column_definition">
6032
+ <structfield>phase</structfield> <type>text</type>
6033
+ </para>
6034
+ <para>
6035
+ Current processing phase. See <xref linkend="repack-phases"/>.
6036
+ </para></entry>
6037
+ </row>
6038
+
6039
+ <row>
6040
+ <entry role="catalog_table_entry"><para role="column_definition">
6041
+ <structfield>repack_index_relid</structfield> <type>oid</type>
6042
+ </para>
6043
+ <para>
6044
+ If the table is being scanned using an index, this is the OID of the
6045
+ index being used; otherwise, it is zero.
6046
+ </para></entry>
6047
+ </row>
6048
+
6049
+ <row>
6050
+ <entry role="catalog_table_entry"><para role="column_definition">
6051
+ <structfield>heap_tuples_scanned</structfield> <type>bigint</type>
6052
+ </para>
6053
+ <para>
6054
+ Number of heap tuples scanned.
6055
+ This counter only advances when the phase is
6056
+ <literal>seq scanning heap</literal>,
6057
+ <literal>index scanning heap</literal>
6058
+ or <literal>writing new heap</literal>.
6059
+ </para></entry>
6060
+ </row>
6061
+
6062
+ <row>
6063
+ <entry role="catalog_table_entry"><para role="column_definition">
6064
+ <structfield>heap_tuples_written</structfield> <type>bigint</type>
6065
+ </para>
6066
+ <para>
6067
+ Number of heap tuples written.
6068
+ This counter only advances when the phase is
6069
+ <literal>seq scanning heap</literal>,
6070
+ <literal>index scanning heap</literal>
6071
+ or <literal>writing new heap</literal>.
6072
+ </para></entry>
6073
+ </row>
6074
+
6075
+ <row>
6076
+ <entry role="catalog_table_entry"><para role="column_definition">
6077
+ <structfield>heap_blks_total</structfield> <type>bigint</type>
6078
+ </para>
6079
+ <para>
6080
+ Total number of heap blocks in the table. This number is reported
6081
+ as of the beginning of <literal>seq scanning heap</literal>.
6082
+ </para></entry>
6083
+ </row>
6084
+
6085
+ <row>
6086
+ <entry role="catalog_table_entry"><para role="column_definition">
6087
+ <structfield>heap_blks_scanned</structfield> <type>bigint</type>
6088
+ </para>
6089
+ <para>
6090
+ Number of heap blocks scanned. This counter only advances when the
6091
+ phase is <literal>seq scanning heap</literal>.
6092
+ </para></entry>
6093
+ </row>
6094
+
6095
+ <row>
6096
+ <entry role="catalog_table_entry"><para role="column_definition">
6097
+ <structfield>index_rebuild_count</structfield> <type>bigint</type>
6098
+ </para>
6099
+ <para>
6100
+ Number of indexes rebuilt. This counter only advances when the phase
6101
+ is <literal>rebuilding index</literal>.
6102
+ </para></entry>
6103
+ </row>
6104
+ </tbody>
6105
+ </tgroup>
6106
+ </table>
6107
+
6108
+ <table id="repack-phases">
6109
+ <title>REPACK Phases</title>
6110
+ <tgroup cols="2">
6111
+ <colspec colname="col1" colwidth="1*"/>
6112
+ <colspec colname="col2" colwidth="2*"/>
6113
+ <thead>
6114
+ <row>
6115
+ <entry>Phase</entry>
6116
+ <entry>Description</entry>
6117
+ </row>
6118
+ </thead>
6119
+
6120
+ <tbody>
6121
+ <row>
6122
+ <entry><literal>initializing</literal></entry>
6123
+ <entry>
6124
+ The command is preparing to begin scanning the heap. This phase is
6125
+ expected to be very brief.
6126
+ </entry>
6127
+ </row>
6128
+ <row>
6129
+ <entry><literal>seq scanning heap</literal></entry>
6130
+ <entry>
6131
+ The command is currently scanning the table using a sequential scan.
6132
+ </entry>
6133
+ </row>
6134
+ <row>
6135
+ <entry><literal>index scanning heap</literal></entry>
6136
+ <entry>
6137
+ <command>REPACK</command> is currently scanning the table using an index scan.
6138
+ </entry>
6139
+ </row>
6140
+ <row>
6141
+ <entry><literal>sorting tuples</literal></entry>
6142
+ <entry>
6143
+ <command>REPACK</command> is currently sorting tuples.
6144
+ </entry>
6145
+ </row>
6146
+ <row>
6147
+ <entry><literal>writing new heap</literal></entry>
6148
+ <entry>
6149
+ <command>REPACK</command> is currently writing the new heap.
6150
+ </entry>
6151
+ </row>
6152
+ <row>
6153
+ <entry><literal>swapping relation files</literal></entry>
6154
+ <entry>
6155
+ The command is currently swapping newly-built files into place.
6156
+ </entry>
6157
+ </row>
6158
+ <row>
6159
+ <entry><literal>rebuilding index</literal></entry>
6160
+ <entry>
6161
+ The command is currently rebuilding an index.
6162
+ </entry>
6163
+ </row>
6164
+ <row>
6165
+ <entry><literal>performing final cleanup</literal></entry>
6166
+ <entry>
6167
+ The command is performing final cleanup. When this phase is
6168
+ completed, <command>REPACK</command> will end.
6169
+ </entry>
6170
+ </row>
6171
+ </tbody>
6172
+ </tgroup>
6173
+ </table>
6174
+ </sect2>
6175
+
5946
6176
<sect2 id="copy-progress-reporting">
5947
6177
<title>COPY Progress Reporting</title>
5948
6178
0 commit comments