aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2023-09-19 11:53:51 +0300
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2023-09-19 11:53:51 +0300
commitbf094372d14bf00f1c04f70f6ec5790f8b2c8801 (patch)
tree49780c864d9ab468ffd118b7442382bfa957289e /src
parent9847ca2c79bef27b9bab44b2243fe951b7c62b36 (diff)
downloadpostgresql-bf094372d14bf00f1c04f70f6ec5790f8b2c8801.tar.gz
postgresql-bf094372d14bf00f1c04f70f6ec5790f8b2c8801.zip
Fix GiST README's explanation of the NSN cross-check.
The text got the condition backwards, it's "NSN > LSN", not "NSN < LSN". While we're at it, expand it a little for clarity. Reviewed-by: Daniel Gustafsson Discussion: https://www.postgresql.org/message-id/4cb46e18-e688-524a-0f73-b1f03ed5d6ee@iki.fi
Diffstat (limited to 'src')
-rw-r--r--src/backend/access/gist/README8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/backend/access/gist/README b/src/backend/access/gist/README
index efb2730e181..8015ff19f05 100644
--- a/src/backend/access/gist/README
+++ b/src/backend/access/gist/README
@@ -271,10 +271,10 @@ should be visited too. When split inserts the downlink to the parent, it
clears the F_FOLLOW_RIGHT flag in the child, and sets the NSN field in the
child page header to match the LSN of the insertion on the parent. If the
F_FOLLOW_RIGHT flag is not set, a scan compares the NSN on the child and the
-LSN it saw in the parent. If NSN < LSN, the scan looked at the parent page
-before the downlink was inserted, so it should follow the rightlink. Otherwise
-the scan saw the downlink in the parent page, and will/did follow that as
-usual.
+LSN it saw in the parent. If the child's NSN is greater than the LSN seen on
+the parent, the scan looked at the parent page before the downlink was
+inserted, so it should follow the rightlink. Otherwise the scan saw the
+downlink in the parent page, and will/did follow that as usual.
A scan can't normally see a page with the F_FOLLOW_RIGHT flag set, because
a page split keeps the child pages locked until the downlink has been inserted