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

Commit265ea56

Browse files
committed
Set right-links during sorted GiST index build.
This is not strictly necessary, as the right-links are only needed byscans that are concurrent with page splits, and neither scans or pagesplits can happen during sorted index build. But it seems like a goodidea to set them anyway, if we e.g. want to add a check to amcheck inthe future to verify that the chain of right-links is complete.Author: Andrey BorodinDiscussion:https://www.postgresql.org/message-id/4D68C21F-9FB9-41DA-B663-FDFC8D143788%40yandex-team.ru
1 parent6b1c5ca commit265ea56

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

‎src/backend/access/gist/gistbuild.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,19 @@ gist_indexsortbuild_pagestate_flush(GISTBuildState *state,
540540
/* Re-initialize the page buffer for next page on this level. */
541541
pagestate->page=palloc(BLCKSZ);
542542
gistinitpage(pagestate->page,isleaf ?F_LEAF :0);
543+
544+
/*
545+
* Set the right link to point to the previous page. This is just for
546+
* debugging purposes: GiST only follows the right link if a page is split
547+
* concurrently to a scan, and that cannot happen during index build.
548+
*
549+
* It's a bit counterintuitive that we set the right link on the new page
550+
* to point to the previous page, and not the other way round. But GiST
551+
* pages are not ordered like B-tree pages are, so as long as the
552+
* right-links form a chain through all the pages in the same level, the
553+
* order doesn't matter.
554+
*/
555+
GistPageGetOpaque(pagestate->page)->rightlink=blkno;
543556
}
544557

545558
staticvoid

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp