Doc: indexUnchanged is strictly a hint.
authorPeter Geoghegan
Tue, 24 Oct 2023 16:27:27 +0000 (09:27 -0700)
committerPeter Geoghegan
Tue, 24 Oct 2023 16:27:27 +0000 (09:27 -0700)
Clearly spell out the limitations of aminsert()'s indexUnchanged hinting
mechanism in the index AM documentation.

Oversight in commit 9dc718bd, which added the "logically unchanged
index" hint (which is used to trigger bottom-up index deletion).

Author: Peter Geoghegan 
Reported-By: Tom Lane
Reviewed-By: Tom Lane
Discussion: https://postgr.es/m/CAH2-WzmU_BQ=-H9L+bxTSMQBqHMjp1DSwGypvL0gKs+dTOfkKg@mail.gmail.com
Backpatch: 14-, where indexUnchanged hinting was introduced.

doc/src/sgml/indexam.sgml

index e813e2b620afbb37fc1b1b01dda81e449c2e7522..30eda37afa8e895ce00a2a41d147fd404efa7933 100644 (file)
@@ -332,9 +332,13 @@ aminsert (Relation indexRelation,
    modify any columns covered by the index, but nevertheless requires a
    new version in the index.  The index AM may use this hint to decide
    to apply bottom-up index deletion in parts of the index where many
-   versions of the same logical row accumulate.  Note that updating a
-   non-key column does not affect the value of
-   indexUnchanged.
+   versions of the same logical row accumulate.  Note that updating a non-key
+   column or a column that only appears in a partial index predicate does not
+   affect the value of indexUnchanged.  The core code
+   determines each tuple's indexUnchanged value using a low
+   overhead approach that allows both false positives and false negatives.
+   Index AMs must not treat indexUnchanged as an
+   authoritative source of information about tuple visibility or versioning.