aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/misc/postgresql.conf.sample
diff options
context:
space:
mode:
authorPeter Geoghegan <pg@bowt.ie>2022-02-16 17:15:50 -0800
committerPeter Geoghegan <pg@bowt.ie>2022-02-16 17:15:50 -0800
commit74388a1ac36d2f0206c5477eeddc636d7947a5a4 (patch)
tree7203dcf90eff5371ff05bfdd542f17fd73da252a /src/backend/utils/misc/postgresql.conf.sample
parentd61a361d1aef1231db61162d99b635b89c73169d (diff)
downloadpostgresql-74388a1ac36d2f0206c5477eeddc636d7947a5a4.tar.gz
postgresql-74388a1ac36d2f0206c5477eeddc636d7947a5a4.zip
Avoid VACUUM reltuples distortion.
Add a heuristic that avoids distortion in the pg_class.reltuples estimates used by VACUUM. Without the heuristic, successive manually run VACUUM commands (run against a table that is never modified after initial bulk loading) will scan the same page in each VACUUM operation. Eventually pg_class.reltuples may reach the point where one single heap page is accidentally considered highly representative of the entire table. This is likely to be completely wrong, since the last heap page typically has fewer tuples than average for the table. It's not obvious that this was a problem prior to commit 44fa8488, which made vacuumlazy.c consistently scan the last heap page (even when it is all-visible in the visibility map). It seems possible that there were more subtle variants of the same problem that went unnoticed for quite some time, though. Commit 44fa8488 simplified certain aspects of when and how relation truncation was considered, but it did not introduce the "scan the last page" behavior. Essentially the same behavior was introduced much earlier, in commit e8429082. It was conditioned on whether or not truncation looked promising towards the end of the initial heap pass by VACUUM until recently, which was at least somewhat protective. That doesn't seem like something that we should be relying on, though. Author: Peter Geoghegan <pg@bowt.ie> Discussion: https://postgr.es/m/CAH2-WzkNKORurux459M64mR63Aw4Jq7MBRVcX=CvALqN3A88WA@mail.gmail.com
Diffstat (limited to 'src/backend/utils/misc/postgresql.conf.sample')
0 files changed, 0 insertions, 0 deletions