summaryrefslogtreecommitdiff
path: root/src/backend/access/gist/gist.c
diff options
context:
space:
mode:
authorPeter Geoghegan <pg@bowt.ie>2022-08-19 09:26:08 -0700
committerPeter Geoghegan <pg@bowt.ie>2022-08-19 09:26:08 -0700
commit3097bde7dd1d9e7b1127b24935e70ca4609e22b2 (patch)
tree22d6899239372e45e0cfecb0574526a7d7446918 /src/backend/access/gist/gist.c
parent7d12693473eca4008c5c53bb36a5f083068a941b (diff)
downloadpostgresql-3097bde7dd1d9e7b1127b24935e70ca4609e22b2.tar.gz
Avoid reltuples distortion in very small tables.
Consistently avoid trusting a sample of only one page at the point that VACUUM determines a new reltuples for the target table (though only when the table is larger than a single page). This is follow-up work to commit 74388a1a, which added a heuristic to prevent reltuples from becoming distorted by successive VACUUM operations that each scan only a single heap page (which was itself more or less a bugfix for an issue in commit 44fa8488, which simplified VACUUM's handling of scanned pages). The original bugfix commit did not account for certain remaining cases that where not affected by its "2% of total relpages" heuristic. This happened with relations that are small enough that just one of its pages exceeded the 2% threshold, yet still big enough for VACUUM to deem skipping most of its pages via the visibility map worthwhile. reltuples could still become distorted over time with such a table, at least in scenarios where the VACUUM command is run repeatedly and without the table itself ever changing. Author: Peter Geoghegan <pg@bowt.ie> Discussion: https://postgr.es/m/CAH2-Wzk7d4m3oEbEWkWQKd+gz-eD_peBvdXVk1a_KBygXadFeg@mail.gmail.com Backpatch: 15-, where the rules for scanned pages changed.
Diffstat (limited to 'src/backend/access/gist/gist.c')
0 files changed, 0 insertions, 0 deletions