PostgreSQL 18 中文参考文档(未翻译部分保留英文)🌐 切换到英文原版 →

Chapter 69. 规划器如何使用统计信息

Table of Contents

69.1. 行数预估实战范例
69.2. 多变量统计信息范例
69.2.1. 函数依赖
69.2.2. 多变量非重复值计数
69.2.3. MCV 高频值列表
69.3. 规划器统计信息与安全权限

This chapter builds on the material covered in Section 14.1 and Section 14.2 to show some additional details about how the planner uses the system statistics to estimate the number of rows each part of a query might return. This is a significant part of the planning process, providing much of the raw material for cost calculation.

The intent of this chapter is not to document the code in detail, but to present an overview of how it works. This will perhaps ease the learning curve for someone who subsequently wishes to read the code.