Skip to content

Commit 4ce8a77

Browse files
committed
Added hint bits horizon
1 parent cb493eb commit 4ce8a77

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

src/backend/access/heap/heapam_visibility.c

+13
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@
7878
#include "utils/builtins.h"
7979
#include "utils/snapmgr.h"
8080

81+
static TransactionId hint_bit_horizon = InvalidTransactionId;
82+
8183

8284
/*
8385
* SetHintBits()
@@ -127,6 +129,11 @@ SetHintBits(HeapTupleHeader tuple, Buffer buffer,
127129
}
128130
}
129131

132+
if (TransactionIdIsValid(hint_bit_horizon) &&
133+
TransactionIdIsValid(xid) &&
134+
TransactionIdFollows(xid, hint_bit_horizon))
135+
return;
136+
130137
tuple->t_infomask |= infomask;
131138
MarkBufferDirtyHint(buffer, true);
132139
}
@@ -1786,3 +1793,9 @@ HeapTupleSatisfiesVisibility(HeapTuple htup, Snapshot snapshot, Buffer buffer)
17861793

17871794
return false; /* keep compiler quiet */
17881795
}
1796+
1797+
void
1798+
SetHintBitsHorizon(TransactionId new_horizon)
1799+
{
1800+
hint_bit_horizon = new_horizon;
1801+
}

src/include/access/heapam.h

+2
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,8 @@ extern bool HeapTupleHeaderIsOnlyLocked(HeapTupleHeader tuple);
412412
extern bool HeapTupleIsSurelyDead(HeapTuple htup,
413413
struct GlobalVisState *vistest);
414414

415+
extern void SetHintBitsHorizon(TransactionId new_horizon);
416+
415417
/*
416418
* To avoid leaking too much knowledge about reorderbuffer implementation
417419
* details this is implemented in reorderbuffer.c not heapam_visibility.c

0 commit comments

Comments
 (0)