> 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/16/internals/how-the-planner-uses-statistics.md).

# 75. 查詢計畫如何使用統計資訊

本章以[第 14.1 節](/16/the-sql-language/performance-tips/using-explain.md)和[第 14.2 節](/16/the-sql-language/performance-tips/statistics-used-by-the-planner.md)介紹的內容為基礎，以顯示有關查詢計畫如何使用系統統計資訊來估計查詢的每個部分可能回傳的資料筆數及其他詳細資訊。這是查詢計劃中的重要過程，它們為計算成本提供了大量原始數據。

本章的目的不是詳細記錄程式語法，而是概述其工作原理。對於以後希望閱讀程式的人來說，這可以降低學習難度。


---

# 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/16/internals/how-the-planner-uses-statistics.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.
