aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/backend/access/gist/README1
-rw-r--r--src/include/access/gist.h15
2 files changed, 12 insertions, 4 deletions
diff --git a/src/backend/access/gist/README b/src/backend/access/gist/README
index 8ca0cf78cc9..25cab0047b6 100644
--- a/src/backend/access/gist/README
+++ b/src/backend/access/gist/README
@@ -10,6 +10,7 @@ GiST stands for Generalized Search Tree. It was introduced in the seminal paper
Jeffrey F. Naughton, Avi Pfeffer:
http://www.sai.msu.su/~megera/postgres/gist/papers/gist.ps
+ https://dsf.berkeley.edu/papers/sigmod97-gist.pdf
and implemented by J. Hellerstein and P. Aoki in an early version of
PostgreSQL (more details are available from The GiST Indexing Project
diff --git a/src/include/access/gist.h b/src/include/access/gist.h
index aa5f1763dd0..4b06575d987 100644
--- a/src/include/access/gist.h
+++ b/src/include/access/gist.h
@@ -51,13 +51,20 @@
#define F_HAS_GARBAGE (1 << 4) /* some tuples on the page are dead,
* but not deleted yet */
-/* NSN - node sequence number, a special-purpose LSN */
+/*
+ * NSN (node sequence number) is a special-purpose LSN which is stored on each
+ * index page in GISTPageOpaqueData and updated only during page splits. By
+ * recording the parent's LSN in GISTSearchItem.parentlsn, it is possible to
+ * detect concurrent child page splits by checking if parentlsn < child's NSN,
+ * and handle them properly. The child page's LSN is insufficient for this
+ * purpose since it is updated for every page change.
+ */
typedef XLogRecPtr GistNSN;
/*
- * A bogus LSN / NSN value used during index build. Must be smaller than any
- * real or fake unlogged LSN, so that after an index build finishes, all the
- * splits are considered completed.
+ * A fake LSN / NSN value used during index builds. Must be smaller than any
+ * real or fake (unlogged) LSN generated after the index build completes so
+ * that all splits are considered complete.
*/
#define GistBuildLSN ((XLogRecPtr) 1)