Skip to content

Commit e7327fa

Browse files
committed
Added hint bits horizon
1 parent 349c20b commit e7327fa

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

src/backend/access/heap/heapam_visibility.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@
8080
#include "utils/combocid.h"
8181
#include "utils/snapmgr.h"
8282

83+
static TransactionId hint_bit_horizon = InvalidTransactionId;
8384

8485
/*
8586
* SetHintBits()
@@ -129,6 +130,11 @@ SetHintBits(HeapTupleHeader tuple, Buffer buffer,
129130
}
130131
}
131132

133+
if (TransactionIdIsValid(hint_bit_horizon) &&
134+
TransactionIdIsValid(xid) &&
135+
TransactionIdFollows(xid, hint_bit_horizon))
136+
return;
137+
132138
tuple->t_infomask |= infomask;
133139
MarkBufferDirtyHint(buffer, true);
134140
}
@@ -1788,3 +1794,9 @@ HeapTupleSatisfiesVisibility(HeapTuple htup, Snapshot snapshot, Buffer buffer)
17881794

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

src/include/access/heapam.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,8 @@ extern bool HeapTupleHeaderIsOnlyLocked(HeapTupleHeader tuple);
320320
extern bool HeapTupleIsSurelyDead(HeapTuple htup,
321321
struct GlobalVisState *vistest);
322322

323+
extern void SetHintBitsHorizon(TransactionId new_horizon);
324+
323325
/*
324326
* To avoid leaking too much knowledge about reorderbuffer implementation
325327
* details this is implemented in reorderbuffer.c not heapam_visibility.c

0 commit comments

Comments
 (0)