summaryrefslogtreecommitdiff
path: root/src/backend/access
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/access')
-rw-r--r--src/backend/access/nbtree/nbtinsert.c2
-rw-r--r--src/backend/access/nbtree/nbtpage.c10
-rw-r--r--src/backend/access/nbtree/nbtree.c2
3 files changed, 8 insertions, 6 deletions
diff --git a/src/backend/access/nbtree/nbtinsert.c b/src/backend/access/nbtree/nbtinsert.c
index 2d9c89cb6c1..df2f1fd7837 100644
--- a/src/backend/access/nbtree/nbtinsert.c
+++ b/src/backend/access/nbtree/nbtinsert.c
@@ -1974,7 +1974,7 @@ _bt_vacuum_one_page(Relation rel, Buffer buffer)
}
if (ndeletable > 0)
- _bt_delitems(rel, buffer, deletable, ndeletable);
+ _bt_delitems(rel, buffer, deletable, ndeletable, false);
/*
* Note: if we didn't find any LP_DEAD items, then the page's
diff --git a/src/backend/access/nbtree/nbtpage.c b/src/backend/access/nbtree/nbtpage.c
index d1a49633936..a89e3ba84f4 100644
--- a/src/backend/access/nbtree/nbtpage.c
+++ b/src/backend/access/nbtree/nbtpage.c
@@ -650,7 +650,8 @@ _bt_page_recyclable(Page page)
*/
void
_bt_delitems(Relation rel, Buffer buf,
- OffsetNumber *itemnos, int nitems)
+ OffsetNumber *itemnos, int nitems,
+ bool inVacuum)
{
Page page = BufferGetPage(buf);
BTPageOpaque opaque;
@@ -662,11 +663,12 @@ _bt_delitems(Relation rel, Buffer buf,
PageIndexMultiDelete(page, itemnos, nitems);
/*
- * We can clear the vacuum cycle ID since this page has certainly been
- * processed by the current vacuum scan.
+ * If this is within VACUUM, we can clear the vacuum cycle ID since this
+ * page has certainly been processed by the current vacuum scan.
*/
opaque = (BTPageOpaque) PageGetSpecialPointer(page);
- opaque->btpo_cycleid = 0;
+ if (inVacuum)
+ opaque->btpo_cycleid = 0;
/*
* Mark the page as not containing any LP_DEAD items. This is not
diff --git a/src/backend/access/nbtree/nbtree.c b/src/backend/access/nbtree/nbtree.c
index 8b30331be4b..6226f2cd3c7 100644
--- a/src/backend/access/nbtree/nbtree.c
+++ b/src/backend/access/nbtree/nbtree.c
@@ -889,7 +889,7 @@ restart:
*/
if (ndeletable > 0)
{
- _bt_delitems(rel, buf, deletable, ndeletable);
+ _bt_delitems(rel, buf, deletable, ndeletable, true);
stats->tuples_removed += ndeletable;
/* must recompute maxoff */
maxoff = PageGetMaxOffsetNumber(page);