> For the complete documentation index, see [llms.txt](https://docs.postgresql.tw/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.postgresql.tw/19/server-administration/monitoring/monitoring-stats/monitoring-pg-stat-replication-slots-view.md). Agents can also search and read this documentation through its [MCP server](https://docs.postgresql.tw/~gitbook/mcp).

# 27.2.5. pg\_stat\_replication\_slots

## 27.2.5. `pg_stat_replication_slots` [#](#monitoring-pg-stat-replication-slots-view) <a href="#monitoring-pg-stat-replication-slots-view" id="monitoring-pg-stat-replication-slots-view"></a>

`pg_stat_replication_slots` 檢視表中，每個 邏輯複寫插槽都會有一筆資料列，顯示有關其使用情形的統計資訊。

### 表 27.15. `pg_stat_replication_slots` 檢視表 [#](#pg-stat-replication-slots-view) <a href="#pg-stat-replication-slots-view" id="pg-stat-replication-slots-view"></a>

| <p>欄位類型</p><p>說明</p>                                                                                                                                                                                           |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p><code>slot\_name</code> <code>text</code></p><p>該複寫插槽在整個叢集中唯一的識別碼</p>                                                                                                                                       |
| <p><code>spill\_txns</code> <code>bigint</code></p><p>一旦邏輯解碼用於從 WAL 解碼變更所使用的記憶體超過 <code>logical\_decoding\_work\_mem</code>，被溢出（spill）至磁碟的交易數量。 此計數器對最上層交易與子交易都會遞增。</p>                                        |
| <p><code>spill\_count</code> <code>bigint</code></p><p>在為此插槽從 WAL 解碼變更時，交易被溢出至磁碟的次數。 每當有交易被溢出時，此計數器就會遞增， 而同一個交易可能會被溢出多次。</p>                                                                                   |
| <p><code>spill\_bytes</code> <code>bigint</code></p><p>在為此插槽執行從 WAL 解碼變更的過程中，被溢出至磁碟的已解碼 交易資料量。此計數器及其他溢出計數器，可用來估算邏輯 解碼期間所發生的 I/O，並可用來調校 <code>logical\_decoding\_work\_mem</code>。</p>                          |
| <p><code>stream\_txns</code> <code>bigint</code></p><p>在此插槽用於從 WAL 解碼變更的邏輯解碼記憶體使用量超過 <code>logical\_decoding\_work\_mem</code> 之後，被串流（stream）傳送至解碼輸出 外掛程式的進行中交易數量。串流僅適用於最上層交易 （子交易無法被獨立串流），因此此計數器不會對子交易遞增。</p> |
| <p><code>stream\_countbigint</code></p><p>在為此插槽從 WAL 解碼變更時，進行中交易被串流傳送至解碼輸出 外掛程式的次數。每當有交易被串流傳送時， 此計數器就會遞增，而同一個交易可能會被串流傳送多次。</p>                                                                                 |
| <p><code>stream\_bytesbigint</code></p><p>在為此插槽執行從 WAL 解碼變更的過程中，為將進行中交易串流傳送至 解碼輸出外掛程式所解碼的交易資料量。此插槽的此計數器及其他串流 計數器，可用來調校 <code>logical\_decoding\_work\_mem</code>。</p>                                          |
| <p><code>total\_txns</code> <code>bigint</code></p><p>為此插槽傳送至解碼輸出外掛程式的已解碼交易數量。此欄位僅計算 最上層交易，不會對子交易遞增。請注意，此欄位包含已被 串流傳送及／或溢出的交易。</p>                                                                              |
| <p><code>total\_bytesbigint</code></p><p>在為此插槽從 WAL 解碼變更的過程中，為將交易傳送至 解碼輸出外掛程式所解碼的交易資料量。請注意，此欄位包含已被 串流傳送及／或溢出的資料。</p>                                                                                           |
| <p><code>stats\_reset</code> <code>timestamp with time zone</code></p><p>這些統計資訊上次重設的時間</p>                                                                                                                     |

<br>

[返回 27.2. 累計統計系統](https://docs.postgresql.tw/19/server-administration/monitoring/monitoring-stats.md#monitoring-stats)

***

原文：[PostgreSQL 18.6 Documentation](https://www.postgresql.org/docs/18/monitoring-stats.html)（原文版本：18.6；核對日期：2026-10-23）


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.postgresql.tw/19/server-administration/monitoring/monitoring-stats/monitoring-pg-stat-replication-slots-view.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
