postgresql/src/backend/access
Peter Geoghegan 48e1291342 Fix nbtree cleanup-only VACUUM stats inaccuracies.
Logic for counting heap TIDs from posting list tuples (added by commit
0d861bbb) was faulty.  It didn't count any TIDs/index tuples in the
event of no callback being set.  This meant that we incorrectly counted
no index tuples in clean-up only VACUUMs, which could lead to
pg_class.reltuples being spuriously set to 0 in affected indexes.

To fix, go back to counting items from the page in cases where there is
no callback.  This approach isn't very accurate, but it works well
enough in practice while avoiding the expense of accessing every index
tuple during cleanup-only VACUUMs.

Author: Peter Geoghegan <pg@bowt.ie>
Reported-By: Jehan-Guillaume de Rorthais <jgdr@dalibo.com>
https://postgr.es/m/20201023174451.69e358f1@firost
Backpatch: 13-, where nbtree deduplication was introduced
2020-11-04 18:42:27 -08:00
..
brin Remove some more useless assignments. 2020-09-04 14:32:19 -04:00
common Yet more elimination of dead stores and useless initializations. 2020-09-05 13:17:32 -04:00
gin Copy editing: fix a bunch of misspellings and poor wording. 2020-09-21 12:43:42 -04:00
gist Fix missing validation for the new GiST sortsupport functions. 2020-10-30 19:30:19 +02:00
hash Invent "amadjustmembers" AM method for validating opclass members. 2020-08-01 17:12:47 -04:00
heap Fix some grammar and typos in comments and docs 2020-11-02 15:14:41 +09:00
index snapshot scalability: Don't compute global horizons while building snapshots. 2020-08-12 16:03:49 -07:00
nbtree Fix nbtree cleanup-only VACUUM stats inaccuracies. 2020-11-04 18:42:27 -08:00
rmgrdesc Fixup some appendStringInfo and appendPQExpBuffer calls 2020-10-15 20:35:17 +13:00
spgist snapshot scalability: Don't compute global horizons while building snapshots. 2020-08-12 16:03:49 -07:00
table Improve handling of dropped relations for REINDEX DATABASE/SCHEMA/SYSTEM 2020-09-02 09:08:12 +09:00
tablesample Move src/backend/utils/hash/hashfn.c to src/common 2020-02-27 09:25:41 +05:30
transam Fix unlinking of SLRU segments. 2020-11-05 13:49:49 +13:00
Makefile Introduce access/{table.h, relation.h}, for generic functions from heapam.h. 2019-01-21 10:51:36 -08:00