aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/nbtree/README
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/access/nbtree/README')
-rw-r--r--src/backend/access/nbtree/README24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/backend/access/nbtree/README b/src/backend/access/nbtree/README
index 7055c242d20..3c703948448 100644
--- a/src/backend/access/nbtree/README
+++ b/src/backend/access/nbtree/README
@@ -520,6 +520,30 @@ normal running after recovery has completed. This is a key capability
because it allows running applications to continue while the standby
changes state into a normally running server.
+The interlocking required to avoid returning incorrect results from
+MVCC scans is not required on standby nodes. That is because
+HeapTupleSatisfiesUpdate(), HeapTupleSatisfiesSelf(),
+HeapTupleSatisfiesDirty() and HeapTupleSatisfiesVacuum() are only
+ever used during write transactions, which cannot exist on the standby.
+This leaves HeapTupleSatisfiesMVCC() and HeapTupleSatisfiesToast(), so
+HeapTupleSatisfiesToast() is the only non-MVCC scan type used on standbys.
+There is one minor exception, which is that the optimizer sometimes
+looks at the boundaries of value ranges using SnapshotDirty, which
+could result in returning a newer value for query statistics; this
+would affect the query plan in rare cases, but not the correctness.
+The risk window is small since the stats look at the min and max values
+in the index, so the scan retrieves a tid then immediately uses it
+to look in the heap. It is unlikely that the tid could have been
+deleted, vacuumed and re-inserted in the time taken to look in the heap
+via direct tid access. So we ignore that scan type as a problem.
+This means if we re-check the results of any scan of a toast index we
+will be able to completely avoid performing the "pin scan" operation
+during replay of VACUUM WAL records.
+
+XXX FIXME: Toast re-checks are not yet added, so we still perform the
+pin scan when replaying vacuum records of toast indexes.
+
+
Other Things That Are Handy to Know
-----------------------------------