postgresql/src/include/access
Peter Geoghegan dd94c2852e Fix "single value strategy" index deletion issue.
It is not appropriate for deduplication to apply single value strategy
when triggered by a bottom-up index deletion pass.  This wastes cycles
because later bottom-up deletion passes will overinterpret older
duplicate tuples that deduplication actually just skipped over "by
design".  It also makes bottom-up deletion much less effective for low
cardinality indexes that happen to cross a meaningless "index has single
key value per leaf page" threshold.

To fix, slightly narrow the conditions under which deduplication's
single value strategy is considered.  We already avoided the strategy
for a unique index, since our high level goal must just be to buy time
for VACUUM to run (not to buy space).  We'll now also avoid it when we
just had a bottom-up pass that reported failure.  The two cases share
the same high level goal, and already overlapped significantly, so this
approach is quite natural.

Oversight in commit d168b666, which added bottom-up index deletion.

Author: Peter Geoghegan <pg@bowt.ie>
Discussion: https://postgr.es/m/CAH2-WznaOvM+Gyj-JQ0X=JxoMDxctDTYjiEuETdAGbF5EUc3MA@mail.gmail.com
Backpatch: 14-, where bottom-up deletion was introduced.
2021-09-21 18:57:32 -07:00
..
amapi.h Pass down "logically unchanged index" hint. 2021-01-13 08:11:00 -08:00
amvalidate.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
attmap.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
attnum.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
brin.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
brin_internal.h Move IS [NOT] NULL handling from BRIN support functions 2021-03-23 00:45:42 +01:00
brin_page.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
brin_pageops.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
brin_revmap.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
brin_tuple.h Initial pgindent and pgperltidy run for v14. 2021-05-12 13:14:10 -04:00
brin_xlog.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
bufmask.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
clog.h Remove unused function prototypes. 2021-01-05 11:42:38 +13:00
commit_ts.h Remove unused function declaration 2021-08-08 23:27:57 +12:00
detoast.h Allow configurable LZ4 TOAST compression. 2021-03-19 15:10:38 -04:00
genam.h Simplify state managed by VACUUM. 2021-04-05 13:21:44 -07:00
generic_xlog.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
gin.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
gin_private.h Pass down "logically unchanged index" hint. 2021-01-13 08:11:00 -08:00
ginblock.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
ginxlog.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
gist.h C comments: improve description of GiST NSN and GistBuildLSN 2021-03-10 17:03:10 -05:00
gist_private.h Pass down "logically unchanged index" hint. 2021-01-13 08:11:00 -08:00
gistscan.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
gistxlog.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
hash.h Pass down "logically unchanged index" hint. 2021-01-13 08:11:00 -08:00
hash_xlog.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
heapam.h Remove tupgone special case from vacuumlazy.c. 2021-04-06 08:49:22 -07:00
heapam_xlog.h Remove tupgone special case from vacuumlazy.c. 2021-04-06 08:49:22 -07:00
heaptoast.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
hio.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
htup.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
htup_details.h Rework HeapTupleHeader macros to reuse itemptr.h 2021-03-25 15:47:48 -03:00
itup.h Support INCLUDE'd columns in SP-GiST. 2021-04-05 18:41:21 -04:00
multixact.h Remove unused function prototypes. 2021-01-05 11:42:38 +13:00
nbtree.h Fix "single value strategy" index deletion issue. 2021-09-21 18:57:32 -07:00
nbtxlog.h Don't consider newly inserted tuples in nbtree VACUUM. 2021-03-10 16:27:01 -08:00
parallel.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
printsimple.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
printtup.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
relation.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
reloptions.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
relscan.h Initial pgindent and pgperltidy run for v14. 2021-05-12 13:14:10 -04:00
rewriteheap.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
rmgr.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
rmgrlist.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
sdir.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
session.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
skey.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
slru.h Prevent excess SimpleLruTruncate() deletion. 2021-01-16 12:21:35 -08:00
spgist.h Pass down "logically unchanged index" hint. 2021-01-13 08:11:00 -08:00
spgist_private.h Re-order pg_attribute columns to eliminate some padding space. 2021-05-23 12:12:09 -04:00
spgxlog.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
stratnum.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
subtrans.h Remove unused function prototypes. 2021-01-05 11:42:38 +13:00
syncscan.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
sysattr.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
table.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
tableam.h Simplify state managed by VACUUM. 2021-04-05 13:21:44 -07:00
timeline.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
toast_compression.h Rethink definition of pg_attribute.attcompression. 2021-05-27 13:24:27 -04:00
toast_helper.h Allow configurable LZ4 TOAST compression. 2021-03-19 15:10:38 -04:00
toast_internals.h Short-circuit slice requests that are for more than the object's size. 2021-03-22 14:01:20 -04:00
transam.h Replace explicit PIN entries in pg_depend with an OID range test. 2021-07-15 11:41:47 -04:00
tsmapi.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
tupconvert.h Fix permission checks on constraint violation errors on partitions. 2021-02-08 11:01:51 +02:00
tupdesc.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
tupdesc_details.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
tupmacs.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
twophase.h Add support for prepared transactions to built-in logical replication. 2021-07-14 07:33:50 +05:30
twophase_rmgr.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
valid.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
visibilitymap.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
xact.h Initial pgindent and pgperltidy run for v14. 2021-05-12 13:14:10 -04:00
xlog.h Document XLOG_INCLUDE_XID a little better 2021-09-21 19:47:53 -03:00
xlog_internal.h Bump XLOG_PAGE_MAGIC for format changes related to FPW compression 2021-06-29 13:57:45 +09:00
xlogarchive.h Revert "Avoid creating archive status ".ready" files too early" 2021-09-04 12:14:30 -04:00
xlogdefs.h Revert "Avoid creating archive status ".ready" files too early" 2021-09-04 12:14:30 -04:00
xloginsert.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
xlogreader.h Revert recovery prefetching feature. 2021-05-10 16:06:09 +12:00
xlogrecord.h Document XLOG_INCLUDE_XID a little better 2021-09-21 19:47:53 -03:00
xlogutils.h Move InRecovery and standbyState global vars to xlogutils.c. 2021-07-31 09:50:26 +03:00