de239d01e7
Previously this code used PageGetHeapFreeSpace on heap pages, and usually used PageGetFreeSpace on index pages (though for some reason GetHashPageStats used PageGetExactFreeSpace instead). The difference is that those functions subtract off the size of a line pointer, and PageGetHeapFreeSpace has some additional rules about returning zero if adding another line pointer would require exceeding MaxHeapTuplesPerPage. Those things make sense when testing to see if a new tuple can be put on the page, but they seem pretty strange for pure statistics collection. Additionally, statapprox_heap had a special rule about counting a "new" page as being fully available space. This also seems strange, because it's not actually usable until VACUUM or some such process initializes the page. Moreover, it's inconsistent with what pgstat_heap does, which is to count such a page as having zero free space. So make it work like pgstat_heap, which as of this patch unconditionally calls PageGetExactFreeSpace. This is more of a definitional change than a bug fix, so no back-patch. The module's documentation doesn't define exactly what "free space" means either, so we left that as-is. Frédéric Yhuel, reviewed by Rafia Sabih and Andreas Karlsson. Discussion: https://postgr.es/m/3a18f843-76f6-4a84-8cca-49537fefa15d@dalibo.com |
||
---|---|---|
.github | ||
config | ||
contrib | ||
doc | ||
src | ||
.cirrus.star | ||
.cirrus.tasks.yml | ||
.cirrus.yml | ||
.dir-locals.el | ||
.editorconfig | ||
.git-blame-ignore-revs | ||
.gitattributes | ||
.gitignore | ||
aclocal.m4 | ||
configure | ||
configure.ac | ||
COPYRIGHT | ||
GNUmakefile.in | ||
HISTORY | ||
Makefile | ||
meson_options.txt | ||
meson.build | ||
README.md |
PostgreSQL Database Management System
This directory contains the source code distribution of the PostgreSQL database management system.
PostgreSQL is an advanced object-relational database management system that supports an extended subset of the SQL standard, including transactions, foreign keys, subqueries, triggers, user-defined types and functions. This distribution also contains C language bindings.
Copyright and license information can be found in the file COPYRIGHT.
General documentation about this version of PostgreSQL can be found at https://www.postgresql.org/docs/devel/. In particular, information about building PostgreSQL from the source code can be found at https://www.postgresql.org/docs/devel/installation.html.
The latest version of this software, and related software, may be obtained at https://www.postgresql.org/download/. For more information look at our web site located at https://www.postgresql.org/.