Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit845ac7f

Browse files
committed
C comments: improve description of GiST NSN and GistBuildLSN
GiST indexes are complex, so adding more details in the code might helpsomeone.Discussion:https://postgr.es/m/20210302164021.GA364@momjian.us
1 parentd872510 commit845ac7f

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

‎src/backend/access/gist/README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ GiST stands for Generalized Search Tree. It was introduced in the seminal paper
1010
Jeffrey F. Naughton, Avi Pfeffer:
1111

1212
http://www.sai.msu.su/~megera/postgres/gist/papers/gist.ps
13+
https://dsf.berkeley.edu/papers/sigmod97-gist.pdf
1314

1415
and implemented by J. Hellerstein and P. Aoki in an early version of
1516
PostgreSQL (more details are available from The GiST Indexing Project

‎src/include/access/gist.h

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,20 @@
5151
#defineF_HAS_GARBAGE(1 << 4)/* some tuples on the page are dead,
5252
* but not deleted yet */
5353

54-
/* NSN - node sequence number, a special-purpose LSN */
54+
/*
55+
* NSN (node sequence number) is a special-purpose LSN which is stored on each
56+
* index page in GISTPageOpaqueData and updated only during page splits. By
57+
* recording the parent's LSN in GISTSearchItem.parentlsn, it is possible to
58+
* detect concurrent child page splits by checking if parentlsn < child's NSN,
59+
* and handle them properly. The child page's LSN is insufficient for this
60+
* purpose since it is updated for every page change.
61+
*/
5562
typedefXLogRecPtrGistNSN;
5663

5764
/*
58-
* Abogus LSN / NSN value used during indexbuild. Must be smaller than any
59-
* real or fake unlogged LSN, so thatafteran index buildfinishes, all the
60-
* splits are consideredcompleted.
65+
* Afake LSN / NSN value used during indexbuilds. Must be smaller than any
66+
* real or fake(unlogged) LSN generatedafterthe index buildcompletes so
67+
*that allsplits are consideredcomplete.
6168
*/
6269
#defineGistBuildLSN((XLogRecPtr) 1)
6370

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp