> 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/internals/catalogs/catalog-pg-statistic-ext.md). Agents can also search and read this documentation through its [MCP server](https://docs.postgresql.tw/~gitbook/mcp).

# 52.52. pg\_statistic\_ext \#

### 52.52. `pg_statistic_ext` [#](#catalog-pg-statistic-ext) <a href="#catalog-pg-statistic-ext" id="catalog-pg-statistic-ext"></a>

系統目錄 `pg_statistic_ext` 存放擴充規劃器統計資訊的定義。此系統目錄中的每一筆資料列對應一個以 [`CREATE STATISTICS`](https://docs.postgresql.tw/19/reference/sql-commands/sql-createstatistics.md) 建立的*統計資訊物件*。

#### 表 52.52. `pg_statistic_ext` 欄位 [#](#catalog-pg-statistic-ext-columns) <a href="#catalog-pg-statistic-ext-columns" id="catalog-pg-statistic-ext-columns"></a>

| <p>欄位類型</p><p>說明</p>                                                                                                                                                                                                                                                                                                              |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p><code>oid</code> <code>oid</code></p><p>資料列識別碼</p>                                                                                                                                                                                                                                                                             |
| <p><code>stxrelid</code> <code>oid</code> （參照 <a href="https://docs.postgresql.tw/19/internals/catalogs/catalog-pg-class.md"><code>pg\_class</code></a>.<code>oid</code>）</p><p>包含此物件所描述之欄位的資料表</p>                                                                                                                               |
| <p><code>stxname</code> <code>name</code></p><p>統計資訊物件的名稱</p>                                                                                                                                                                                                                                                                     |
| <p><code>stxnamespace</code> <code>oid</code> （參照 <a href="https://docs.postgresql.tw/19/internals/catalogs/catalog-pg-namespace.md"><code>pg\_namespace</code></a>.<code>oid</code>）</p><p>包含此統計資訊物件之命名空間的 OID</p>                                                                                                               |
| <p><code>stxowner</code> <code>oid</code> （參照 <a href="https://docs.postgresql.tw/19/internals/catalogs/catalog-pg-authid.md"><code>pg\_authid</code></a>.<code>oid</code>）</p><p>統計資訊物件的擁有者</p>                                                                                                                                  |
| <p><code>stxkeys</code> <code>int2vector</code> （參照 <a href="https://docs.postgresql.tw/19/internals/catalogs/catalog-pg-attribute.md"><code>pg\_attribute</code></a>.<code>attnum</code>）</p><p>屬性編號的陣列，指出此統計資訊物件涵蓋哪些資料表欄位；例如值 <code>1 3</code> 表示涵蓋資料表的第一個與第三個欄位</p>                                                            |
| <p><code>stxstattarget</code> <code>int2</code></p><p><code>stxstattarget</code> 控制 <a href="https://docs.postgresql.tw/19/reference/sql-commands/sql-analyze.md"><code>ANALYZE</code></a> 為此統計資訊物件累積之統計資訊的詳細程度。值為零表示不應收集任何統計資訊。null 值表示使用所參照欄位之統計目標中的最大值（若有設定），否則使用系統預設統計目標。<code>stxstattarget</code> 的正值決定要收集之“最常見值”的目標數量。</p> |
| <p><code>stxkind</code> <code>char\[]</code></p><p>包含已啟用統計資訊種類代碼的陣列；有效值為：<code>d</code> 表示 n-distinct 統計資訊、<code>f</code> 表示函數相依統計資訊、<code>m</code> 表示最常見值（MCV）清單統計資訊，以及 <code>e</code> 表示運算式統計資訊</p>                                                                                                                             |
| <p><code>stxexprs</code> <code>pg\_node\_tree</code></p><p>統計資訊物件中非簡單欄位參照之屬性的運算式樹（採 <code>nodeToString()</code> 表示法）。這是一個清單，每個運算式對應一個元素。若統計資訊物件的所有屬性都是簡單參照，則為 null。</p>                                                                                                                                                           |

<br>

`pg_statistic_ext` 項目會在 [`CREATE STATISTICS`](https://docs.postgresql.tw/19/reference/sql-commands/sql-createstatistics.md) 期間完整填入，但當時並不會計算實際的統計值。後續的 [`ANALYZE`](https://docs.postgresql.tw/19/reference/sql-commands/sql-analyze.md) 命令會計算所需的值，並在 [`pg_statistic_ext_data`](https://docs.postgresql.tw/19/internals/catalogs/catalog-pg-statistic-ext-data.md) 系統目錄中填入一筆項目。

***

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


---

# 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/internals/catalogs/catalog-pg-statistic-ext.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.
