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

Commitda9517f

Browse files
Reset btpo_cycleid in nbtree VACUUM's REDO routine.
Reset btpo_cycleid to 0 in btree_xlog_vacuum for consistency with_bt_delitems_vacuum (the corresponding original execution code). Thismakes things neater.There might be some performance benefit to being consistent like this.When btvacuumpage doesn't call _bt_delitems_vacuum, it can stillproactively reset btpo_cycleid to 0 via a separate hint-like updatemechanism (it does so whenever it sees that it isn't already set to 0).And so it's possible that being consistent about resetting btpo_cycleidlike this will save work later on, after standby promotion: subsequentVACUUMs won't need to clear btpo_cycleid using the hint-like updatemechanism as often as they otherwise would.Author: Peter Geoghegan <pg@bowt.ie>Reviewed-By: Andrey Borodin <x4mmm@yandex-team.ru>Discussion:https://postgr.es/m/CAH2-Wz=+LDFxn9NZyEsCo8ifcyKt6+n-VLyygySEHgMz+oynqw@mail.gmail.com
1 parentc431986 commitda9517f

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

‎src/backend/access/nbtree/nbtxlog.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -634,10 +634,11 @@ btree_xlog_vacuum(XLogReaderState *record)
634634
PageIndexMultiDelete(page, (OffsetNumber*)ptr,xlrec->ndeleted);
635635

636636
/*
637-
*Mark thepage as not containing any LP_DEAD items --- see comments
638-
*in _bt_delitems_vacuum().
637+
*Clear thevacuum cycle ID, and mark the page as not containing any
638+
*LP_DEAD items
639639
*/
640640
opaque=BTPageGetOpaque(page);
641+
opaque->btpo_cycleid=0;
641642
opaque->btpo_flags &= ~BTP_HAS_GARBAGE;
642643

643644
PageSetLSN(page,lsn);
@@ -698,7 +699,10 @@ btree_xlog_delete(XLogReaderState *record)
698699
if (xlrec->ndeleted>0)
699700
PageIndexMultiDelete(page, (OffsetNumber*)ptr,xlrec->ndeleted);
700701

701-
/* Mark the page as not containing any LP_DEAD items */
702+
/*
703+
* Do *not* clear the vacuum cycle ID, but do mark the page as not
704+
* containing any LP_DEAD items
705+
*/
702706
opaque=BTPageGetOpaque(page);
703707
opaque->btpo_flags &= ~BTP_HAS_GARBAGE;
704708

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp