pg.ddx.io pgsql-hackers@postgresql.org mailing list archive
help / color / mirror / Atom feedGiST comment improvement
4+ messages / 2 participants
[nested] [flat]
* GiST comment improvement
@ 2021-03-02 16:40 Bruce Momjian <bruce@momjian.us>
0 siblings, 2 replies; 4+ messages in thread
From: Bruce Momjian @ 2021-03-02 16:40 UTC (permalink / raw)
To: pgsql-hackers; +Cc: Teodor Sigaev <teodor@sigaev.ru>
In talking to Teodor this week, I have written the attached C comment
patch which improves our description of GiST's NSN and GistBuildLSN
values.
--
Bruce Momjian <bruce@momjian.us> https://momjian.us
EDB https://enterprisedb.com
The usefulness of a cup is in its emptiness, Bruce Lee
Attachments:
[text/x-diff] gist.diff (2.2K, ../../20210302164021.GA364@momjian.us/2-gist.diff)
download | inline diff:
From defd16776c8016179a87c3d32ed359570c62727d Mon Sep 17 00:00:00 2001
From: Bruce Momjian <bruce@momjian.us>
Date: Tue, 2 Mar 2021 11:38:14 -0500
Subject: [PATCH] gist squash commit
---
src/backend/access/gist/README | 1 +
src/include/access/gist.h | 15 +++++++++++----
2 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/src/backend/access/gist/README b/src/backend/access/gist/README
index 8ca0cf78cc..25cab0047b 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 aa5f1763dd..4b06575d98 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)
--
2.20.1
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: GiST comment improvement
@ 2021-03-02 17:25 Andrey Borodin <x4mmm@yandex-team.ru>
parent: Bruce Momjian <bruce@momjian.us>
1 sibling, 1 reply; 4+ messages in thread
From: Andrey Borodin @ 2021-03-02 17:25 UTC (permalink / raw)
To: Bruce Momjian <bruce@momjian.us>; +Cc: pgsql-hackers; Teodor Sigaev <teodor@sigaev.ru>
> 2 марта 2021 г., в 21:40, Bruce Momjian <bruce@momjian.us> написал(а):
>
> In talking to Teodor this week, I have written the attached C comment
> patch which improves our description of GiST's NSN and GistBuildLSN
> values.
I'd suggest also add NSN acronym description to Concurrency section of src/backend/access/gist/README. And maybe even to doc/src/sgml/acronyms.sgml. Just for connectivity.
Thanks!
Best regards, Andrey Borodin.
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: GiST comment improvement
@ 2021-03-02 18:12 Bruce Momjian <bruce@momjian.us>
parent: Andrey Borodin <x4mmm@yandex-team.ru>
0 siblings, 0 replies; 4+ messages in thread
From: Bruce Momjian @ 2021-03-02 18:12 UTC (permalink / raw)
To: Andrey Borodin <x4mmm@yandex-team.ru>; +Cc: pgsql-hackers; Teodor Sigaev <teodor@sigaev.ru>
On Tue, Mar 2, 2021 at 10:25:23PM +0500, Andrey Borodin wrote:
>
>
> > 2 марта 2021 г., в 21:40, Bruce Momjian <bruce@momjian.us> написал(а):
> >
> > In talking to Teodor this week, I have written the attached C comment
> > patch which improves our description of GiST's NSN and GistBuildLSN
> > values.
>
> I'd suggest also add NSN acronym description to Concurrency section of src/backend/access/gist/README. And maybe even to doc/src/sgml/acronyms.sgml. Just for connectivity.
Uh, NSN is only something that exists in the source code. Do we document
those cases?
--
Bruce Momjian <bruce@momjian.us> https://momjian.us
EDB https://enterprisedb.com
The usefulness of a cup is in its emptiness, Bruce Lee
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: GiST comment improvement
@ 2021-03-10 22:03 Bruce Momjian <bruce@momjian.us>
parent: Bruce Momjian <bruce@momjian.us>
1 sibling, 0 replies; 4+ messages in thread
From: Bruce Momjian @ 2021-03-10 22:03 UTC (permalink / raw)
To: pgsql-hackers; +Cc: Teodor Sigaev <teodor@sigaev.ru>
On Tue, Mar 2, 2021 at 11:40:21AM -0500, Bruce Momjian wrote:
> In talking to Teodor this week, I have written the attached C comment
> patch which improves our description of GiST's NSN and GistBuildLSN
> values.
Patch applied.
--
Bruce Momjian <bruce@momjian.us> https://momjian.us
EDB https://enterprisedb.com
The usefulness of a cup is in its emptiness, Bruce Lee
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2021-03-10 22:03 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-03-02 16:40 GiST comment improvement Bruce Momjian <bruce@momjian.us>
2021-03-02 17:25 ` Andrey Borodin <x4mmm@yandex-team.ru>
2021-03-02 18:12 ` Bruce Momjian <bruce@momjian.us>
2021-03-10 22:03 ` Bruce Momjian <bruce@momjian.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox