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

# 第 69 章 規劃器如何使用統計資訊

**目錄**

* [69.1. 資料列估計範例](https://docs.postgresql.tw/19/internals/planner-stats-details/row-estimation-examples.md)
* [69.2. 多變量統計資訊範例](https://docs.postgresql.tw/19/internals/planner-stats-details/multivariate-statistics-examples.md)
  * [69.2.1. Functional Dependencies](https://docs.postgresql.tw/19/internals/planner-stats-details/multivariate-statistics-examples.md#functional-dependencies)
  * [69.2.2. Multivariate N-Distinct Counts](https://docs.postgresql.tw/19/internals/planner-stats-details/multivariate-statistics-examples.md#multivariate-ndistinct-counts)
  * [69.2.3. MCV Lists](https://docs.postgresql.tw/19/internals/planner-stats-details/multivariate-statistics-examples.md#mcv-lists)
* [69.3. 規劃器統計資訊與安全性](https://docs.postgresql.tw/19/internals/planner-stats-details/planner-stats-security.md)

本章以[第 14.1 節](https://docs.postgresql.tw/19/the-sql-language/performance-tips/using-explain.md)與[第 14.2 節](https://docs.postgresql.tw/19/the-sql-language/performance-tips/planner-stats.md)的內容為基礎，進一步說明規劃器如何使用系統統計資訊估計查詢各部分可能傳回的資料列數。這是規劃程序的重要部分，提供成本計算所需的大量原始資料。

本章目的不是詳細記錄程式碼，而是概述其運作方式，讓後續想閱讀程式碼的人更容易上手。

***

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


---

# 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/planner-stats-details.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.
