> 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/internals/system-catalogs/pg_statistic_ext.md).

# 51.50. pg\_statistic\_ext

版本：11

The catalog `pg_statistic_ext` holds definitions of extended planner statistics. Each row in this catalog corresponds to a *statistics object* created with [CREATE STATISTICS](https://www.postgresql.org/docs/13/sql-createstatistics.html).

#### **Table 51.50. `pg_statistic_ext` Columns**

| <p>Column Type</p><p>Description</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p><code>oid</code> <code>oid</code></p><p>Row identifier</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| <p><code>stxrelid</code> <code>oid</code> (references <a href="https://www.postgresql.org/docs/13/catalog-pg-class.html"><code>pg\_class</code></a>.<code>oid</code>)</p><p>Table containing the columns described by this object</p>                                                                                                                                                                                                                                                                                                                                            |
| <p><code>stxname</code> <code>name</code></p><p>Name of the statistics object</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| <p><code>stxnamespace</code> <code>oid</code> (references <a href="https://www.postgresql.org/docs/13/catalog-pg-namespace.html"><code>pg\_namespace</code></a>.<code>oid</code>)</p><p>The OID of the namespace that contains this statistics object</p>                                                                                                                                                                                                                                                                                                                        |
| <p><code>stxowner</code> <code>oid</code> (references <a href="https://www.postgresql.org/docs/13/catalog-pg-authid.html"><code>pg\_authid</code></a>.<code>oid</code>)</p><p>Owner of the statistics object</p>                                                                                                                                                                                                                                                                                                                                                                 |
| <p><code>stxstattarget</code> <code>int4</code></p><p><code>stxstattarget</code> controls the level of detail of statistics accumulated for this statistics object by <a href="https://www.postgresql.org/docs/13/sql-analyze.html">ANALYZE</a>. A zero value indicates that no statistics should be collected. A negative value says to use the maximum of the statistics targets of the referenced columns, if set, or the system default statistics target. Positive values of <code>stxstattarget</code> determine the target number of “most common values” to collect.</p> |
| <p><code>stxkeys</code> <code>int2vector</code> (references <a href="https://www.postgresql.org/docs/13/catalog-pg-attribute.html"><code>pg\_attribute</code></a>.<code>attnum</code>)</p><p>An array of attribute numbers, indicating which table columns are covered by this statistics object; for example a value of <code>1 3</code> would mean that the first and the third table columns are covered</p>                                                                                                                                                                  |
| <p><code>stxkind</code> <code>char\[]</code></p><p>An array containing codes for the enabled statistic kinds; valid values are: <code>d</code> for n-distinct statistics, <code>f</code> for functional dependency statistics, and <code>m</code> for most common values (MCV) list statistics</p>                                                                                                                                                                                                                                                                               |

The `pg_statistic_ext` entry is filled in completely during `CREATE STATISTICS`, but the actual statistical values are not computed then. Subsequent `ANALYZE` commands compute the desired values and populate an entry in the [`pg_statistic_ext_data`](https://www.postgresql.org/docs/13/catalog-pg-statistic-ext-data.html) catalog.


---

# 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/internals/system-catalogs/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.
