> 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/progress-reporting/cluster-progress-reporting.md). Agents can also search and read this documentation through its [MCP server](https://docs.postgresql.tw/~gitbook/mcp).

# 27.4.2. CLUSTER 進度回報

## 27.4.2. CLUSTER 進度回報 [#](#cluster-progress-reporting) <a href="#cluster-progress-reporting" id="cluster-progress-reporting"></a>

每當 `CLUSTER` 或 `VACUUM FULL` 正在執行時，`pg_stat_progress_cluster` 檢視表中，就會針對每個目前正在執行其中一項命令的後端， 各含有一列。下方的表格， 說明了會被回報的資訊，並提供如何解讀這些資訊的說明。

### 表 27.40. `pg_stat_progress_cluster` 檢視表 [#](#pg-stat-progress-cluster-view) <a href="#pg-stat-progress-cluster-view" id="pg-stat-progress-cluster-view"></a>

| <p>欄位型別</p><p>說明</p>                                                                                                                                                                                |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p><code>pid</code> <code>integer</code></p><p>後端的程序 ID。</p>                                                                                                                                        |
| <p><code>datid</code> <code>oid</code></p><p>此後端所連線之資料庫的 OID。</p>                                                                                                                                   |
| <p><code>datname</code> <code>name</code></p><p>此後端所連線之資料庫的名稱。</p>                                                                                                                                  |
| <p><code>relid</code> <code>oid</code></p><p>正在被重整（cluster）之資料表的 OID。</p>                                                                                                                           |
| <p><code>command</code> <code>text</code></p><p>目前正在執行的命令。可能是 <code>CLUSTER</code> 或 <code>VACUUM FULL</code>。</p>                                                                                  |
| <p><code>phase</code> <code>text</code></p><p>目前的處理階段。請參閱<a href="#cluster-phases">表 27.41</a>。</p>                                                                                                 |
| <p><code>cluster\_index\_relid</code> <code>oid</code></p><p>若此資料表正在使用索引進行掃描， 此欄位即為所使用索引的 OID；否則為零。</p>                                                                                             |
| <p><code>heap\_tuples\_scanned</code> <code>bigint</code></p><p>已掃描的堆積資料列數量。 此計數器只會在階段為 <code>seq scanning heap</code>、 <code>index scanning heap</code> 或 <code>writing new heap</code> 時才會前進。</p> |
| <p><code>heap\_tuples\_written</code> <code>bigint</code></p><p>已寫入的堆積資料列數量。 此計數器只會在階段為 <code>seq scanning heap</code>、 <code>index scanning heap</code> 或 <code>writing new heap</code> 時才會前進。</p> |
| <p><code>heap\_blks\_total</code> <code>bigint</code></p><p>該資料表中堆積區塊的總數。此數字是在 <code>seq scanning heap</code> 開始時所回報的。</p>                                                                          |
| <p><code>heap\_blks\_scanned</code> <code>bigint</code></p><p>已掃描的堆積區塊數。此計數器只會在 階段為 <code>seq scanning heap</code> 時才會前進。</p>                                                                       |
| <p><code>index\_rebuild\_count</code> <code>bigint</code></p><p>已重建的索引數量。此計數器只會在 階段為 <code>rebuilding index</code> 時才會前進。</p>                                                                       |

<br>

### 表 27.41. CLUSTER 與 VACUUM FULL 各階段 [#](#cluster-phases) <a href="#cluster-phases" id="cluster-phases"></a>

| 階段                         | 說明                                                  |
| -------------------------- | --------------------------------------------------- |
| `initializing`             | 此命令正在準備開始掃描堆積。預期此階段 耗時應非常短暫。                        |
| `seq scanning heap`        | 此命令目前正在使用循序掃描來掃描資料表。                                |
| `index scanning heap`      | `CLUSTER` 目前正在使用索引掃描來掃描資料表。                         |
| `sorting tuples`           | `CLUSTER` 目前正在排序資料列。                                |
| `writing new heap`         | `CLUSTER` 目前正在寫入新的堆積。                               |
| `swapping relation files`  | 此命令目前正在將新建置的檔案， 替換到位。                               |
| `rebuilding index`         | 此命令目前正在重建某個索引。                                      |
| `performing final cleanup` | 此命令正在執行最終清理。此階段完成後， `CLUSTER` 或 `VACUUM FULL` 就會結束。 |

<br>

[返回 27.4. 進度回報](https://docs.postgresql.tw/19/server-administration/monitoring/progress-reporting.md#progress-reporting)

***

原文：[PostgreSQL 18.6 Documentation](https://www.postgresql.org/docs/18/progress-reporting.html)（原文版本：18.6；核對日期：2026-09-26）


---

# 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/progress-reporting/cluster-progress-reporting.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.
