Text Size: Normal / Large

Chapter 54. How the Planner Uses Statistics

This chapter builds on the material covered in Section 13.1 and Section 13.2, and shows how the planner uses the system statistics to estimate the number of rows each stage in a query might return. This is a significant part of the planning / optimizing process, providing much of the raw material for cost calculation.

The intent of this chapter is not to document the code — better done in the code itself, 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. As a consequence, the approach chosen is to analyze a series of incrementally more complex examples.

The outputs and algorithms shown below are taken from version 8.0. The behavior of earlier (or later) versions may vary.


User Comments

No comments could be found for this page.

Add Comment

Please use this form to add your own comments regarding your experience with particular features of PostgreSQL, clarifications of the documentation, or hints for other users. Please note, this is not a support forum, and your IP address will be logged. If you have a question or need help, please see the faq, try a mailing list, or join us on IRC. Note that submissions containing URLs or other keywords commonly found in 'spam' comments may be silently discarded. Please contact the webmaster if you think this is happening to you in error.

In order to submit a comment, you must have a community account.

* Comment
 

* denotes required field

Privacy Policy | Project hosted by hub.org | Designed by tinysofa
Copyright © 1996 – 2007 PostgreSQL Global Development Group