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

# 52.53. pg\_statistic\_ext\_data \#

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

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

通常每個已分析過的統計資訊物件會有一筆 `stxdinherit` = `false` 的項目。若資料表有繼承子資料表或分割區，還會另外建立一筆 `stxdinherit` = `true` 的項目。這筆資料列代表涵蓋整個繼承樹的統計資訊物件，亦即你以 `SELECT * FROM table*` 會看到之資料的統計資訊；而 `stxdinherit` = `false` 的資料列則代表 `SELECT * FROM ONLY table` 的結果。

與 [`pg_statistic`](https://docs.postgresql.tw/19/internals/catalogs/catalog-pg-statistic.md) 相同，`pg_statistic_ext_data` 不應開放給一般大眾讀取，因為其內容可能被視為敏感資訊。（例如：欄位中最常見的值組合可能相當值得關注。）[`pg_stats_ext`](https://docs.postgresql.tw/19/internals/views/view-pg-stats-ext.md) 是建立在 `pg_statistic_ext_data` 之上（與 [`pg_statistic_ext`](https://docs.postgresql.tw/19/internals/catalogs/catalog-pg-statistic-ext.md) 連接之後）、可公開讀取的檢視表，只會揭露目前使用者所擁有之資料表的資訊。

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

| <p>欄位類型</p><p>說明</p>                                                                                                                                                                                                 |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p><code>stxoid</code> <code>oid</code> （參照 <a href="https://docs.postgresql.tw/19/internals/catalogs/catalog-pg-statistic-ext.md"><code>pg\_statistic\_ext</code></a>.<code>oid</code>）</p><p>包含此資料之定義的擴充統計資訊物件</p> |
| <p><code>stxdinherit</code> <code>bool</code></p><p>若為真，統計資訊包含子資料表中的值，而不只是指定關聯中的值</p>                                                                                                                                |
| <p><code>stxdndistinct</code> <code>pg\_ndistinct</code></p><p>N-distinct 計數，序列化為 <code>pg\_ndistinct</code> 型別</p>                                                                                                  |
| <p><code>stxddependencies</code> <code>pg\_dependencies</code></p><p>函數相依統計資訊，序列化為 <code>pg\_dependencies</code> 型別</p>                                                                                              |
| <p><code>stxdmcv</code> <code>pg\_mcv\_list</code></p><p>MCV（最常見值）清單統計資訊，序列化為 <code>pg\_mcv\_list</code> 型別</p>                                                                                                      |
| <p><code>stxdexpr</code> <code>pg\_statistic\[]</code></p><p>逐運算式的統計資訊，序列化為 <code>pg\_statistic</code> 型別的陣列</p>                                                                                                     |

<br>

***

原文：[PostgreSQL 18.6 Documentation](https://www.postgresql.org/docs/18/catalog-pg-statistic-ext-data.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-data.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.
