Skip to content

Commit 7c0a818

Browse files
homperpashkinelfe
authored andcommitted
Added hint bits horizon
1 parent aaaf5ca commit 7c0a818

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
@@ -328,6 +328,8 @@ extern bool HeapTupleHeaderIsOnlyLocked(HeapTupleHeader tuple);
328328
extern bool HeapTupleIsSurelyDead(HeapTuple htup,
329329
struct GlobalVisState *vistest);
330330

331+
extern void SetHintBitsHorizon(TransactionId new_horizon);
332+
331333
/*
332334
* To avoid leaking too much knowledge about reorderbuffer implementation
333335
* details this is implemented in reorderbuffer.c not heapam_visibility.c

0 commit comments

Comments
 (0)