@@ -314,6 +314,15 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
314
314
</entry>
315
315
</row>
316
316
317
+ <row>
318
+ <entry><structname>pg_stat_replication_slots</structname><indexterm><primary>pg_stat_replication_slots</primary></indexterm></entry>
319
+ <entry>One row per replication slot, showing statistics about
320
+ replication slot usage.
321
+ See <link linkend="monitoring-pg-stat-replication-slots-view">
322
+ <structname>pg_stat_replication_slots</structname></link> for details.
323
+ </entry>
324
+ </row>
325
+
317
326
<row>
318
327
<entry><structname>pg_stat_wal_receiver</structname><indexterm><primary>pg_stat_wal_receiver</primary></indexterm></entry>
319
328
<entry>Only one row, showing statistics about the WAL receiver from
@@ -2552,6 +2561,88 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
2552
2561
2553
2562
</sect2>
2554
2563
2564
+ <sect2 id="monitoring-pg-stat-replication-slots-view">
2565
+ <title><structname>pg_stat_replication_slots</structname></title>
2566
+
2567
+ <indexterm>
2568
+ <primary>pg_stat_replication_slots</primary>
2569
+ </indexterm>
2570
+
2571
+ <para>
2572
+ The <structname>pg_stat_replication_slots</structname> view will contain
2573
+ one row per logical replication slot, showing statistics about its usage.
2574
+ </para>
2575
+
2576
+ <table id="pg-stat-replication-slots-view" xreflabel="pg_stat_replication_slots">
2577
+ <title><structname>pg_stat_replication_slots</structname> View</title>
2578
+ <tgroup cols="1">
2579
+ <thead>
2580
+ <row>
2581
+ <entry role="catalog_table_entry"><para role="column_definition">
2582
+ Column Type
2583
+ </para>
2584
+ <para>
2585
+ Description
2586
+ </para></entry>
2587
+ </row>
2588
+ </thead>
2589
+
2590
+ <tbody>
2591
+ <row>
2592
+ <entry role="catalog_table_entry"><para role="column_definition">
2593
+ <structfield>name</structfield> <type>text</type>
2594
+ </para>
2595
+ <para>
2596
+ A unique, cluster-wide identifier for the replication slot
2597
+ </para></entry>
2598
+ </row>
2599
+
2600
+ <row>
2601
+ <entry role="catalog_table_entry"><para role="column_definition">
2602
+ <structfield>spill_txns</structfield> <type>bigint</type>
2603
+ </para>
2604
+ <para>
2605
+ Number of transactions spilled to disk after the memory used by
2606
+ logical decoding exceeds <literal>logical_decoding_work_mem</literal>. The
2607
+ counter gets incremented both for toplevel transactions and
2608
+ subtransactions.
2609
+ </para></entry>
2610
+ </row>
2611
+
2612
+ <row>
2613
+ <entry role="catalog_table_entry"><para role="column_definition">
2614
+ <structfield>spill_count</structfield> <type>bigint</type>
2615
+ </para>
2616
+ <para>
2617
+ Number of times transactions were spilled to disk. Transactions
2618
+ may get spilled repeatedly, and this counter gets incremented on every
2619
+ such invocation.
2620
+ </para></entry>
2621
+ </row>
2622
+
2623
+ <row>
2624
+ <entry role="catalog_table_entry"><para role="column_definition">
2625
+ <structfield>spill_bytes</structfield> <type>bigint</type>
2626
+ </para>
2627
+ <para>
2628
+ Amount of decoded transaction data spilled to disk.
2629
+ </para></entry>
2630
+ </row>
2631
+
2632
+ <row>
2633
+ <entry role="catalog_table_entry"><para role="column_definition">
2634
+ <structfield>stats_reset</structfield> <type>timestamp with time zone</type>
2635
+ </para>
2636
+ <para>
2637
+ Time at which these statistics were last reset
2638
+ </para></entry>
2639
+ </row>
2640
+ </tbody>
2641
+ </tgroup>
2642
+ </table>
2643
+
2644
+ </sect2>
2645
+
2555
2646
<sect2 id="monitoring-pg-stat-wal-receiver-view">
2556
2647
<title><structname>pg_stat_wal_receiver</structname></title>
2557
2648
@@ -4802,6 +4893,27 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
4802
4893
can be granted EXECUTE to run the function.
4803
4894
</para></entry>
4804
4895
</row>
4896
+
4897
+ <row>
4898
+ <entry role="func_table_entry"><para role="func_signature">
4899
+ <indexterm>
4900
+ <primary>pg_stat_reset_replication_slot</primary>
4901
+ </indexterm>
4902
+ <function>pg_stat_reset_replication_slot</function> ( <type>text</type> )
4903
+ <returnvalue>void</returnvalue>
4904
+ </para>
4905
+ <para>
4906
+ Resets statistics to zero for a single replication slot, or for all
4907
+ replication slots in the cluster. The argument can be either the name
4908
+ of the slot to reset the stats or NULL. If the argument is NULL, all
4909
+ counters shown in the <structname>pg_stat_replication_slots</structname>
4910
+ view for all replication slots are reset.
4911
+ </para>
4912
+ <para>
4913
+ This function is restricted to superusers by default, but other users
4914
+ can be granted EXECUTE to run the function.
4915
+ </para></entry>
4916
+ </row>
4805
4917
</tbody>
4806
4918
</tgroup>
4807
4919
</table>
0 commit comments