Postgresql 中文操作指南

Chapter 76. How the Planner Uses Statistics

Table of Contents

本章建立在 Section 14.1Section 14.2 中介绍的内容之上,显示了一些关于计划程序如何使用系统统计信息来估算查询的每个部分可能返回的行数的额外细节。这是规划过程的重要部分,提供了成本计算的大量原始材料。

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.