Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit fd0dee0

Browse files
author
Alexander Korotkov
committed
Save epochs during cluster.
1 parent 76bab95 commit fd0dee0

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/backend/utils/sort/tuplesort.c

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3986,13 +3986,17 @@ static void
39863986
writetup_cluster(Tuplesortstate *state, int tapenum, SortTuple *stup)
39873987
{
39883988
HeapTuple tuple = (HeapTuple) stup->tuple;
3989-
unsigned int tuplen = tuple->t_len + sizeof(ItemPointerData) + sizeof(int);
3989+
unsigned int tuplen = tuple->t_len + sizeof(ItemPointerData) + 2 * sizeof(TransactionId) + sizeof(int);
39903990

39913991
/* We need to store t_self, but not other fields of HeapTupleData */
39923992
LogicalTapeWrite(state->tapeset, tapenum,
39933993
&tuplen, sizeof(tuplen));
39943994
LogicalTapeWrite(state->tapeset, tapenum,
39953995
&tuple->t_self, sizeof(ItemPointerData));
3996+
LogicalTapeWrite(state->tapeset, tapenum,
3997+
&tuple->t_xid_base, sizeof(TransactionId));
3998+
LogicalTapeWrite(state->tapeset, tapenum,
3999+
&tuple->t_multi_base, sizeof(TransactionId));
39964000
LogicalTapeWrite(state->tapeset, tapenum,
39974001
tuple->t_data, tuple->t_len);
39984002
if (state->randomAccess) /* need trailing length word? */
@@ -4010,7 +4014,7 @@ static void
40104014
readtup_cluster(Tuplesortstate *state, SortTuple *stup,
40114015
int tapenum, unsigned int tuplen)
40124016
{
4013-
unsigned int t_len = tuplen - sizeof(ItemPointerData) - sizeof(int);
4017+
unsigned int t_len = tuplen - sizeof(ItemPointerData) - 2 * sizeof(TransactionId) - sizeof(int);
40144018
HeapTuple tuple = (HeapTuple) readtup_alloc(state,
40154019
t_len + HEAPTUPLESIZE);
40164020

@@ -4019,9 +4023,12 @@ readtup_cluster(Tuplesortstate *state, SortTuple *stup,
40194023
tuple->t_len = t_len;
40204024
LogicalTapeReadExact(state->tapeset, tapenum,
40214025
&tuple->t_self, sizeof(ItemPointerData));
4026+
LogicalTapeReadExact(state->tapeset, tapenum,
4027+
&tuple->t_xid_base, sizeof(TransactionId));
4028+
LogicalTapeReadExact(state->tapeset, tapenum,
4029+
&tuple->t_multi_base, sizeof(TransactionId));
40224030
/* We don't currently bother to reconstruct t_tableOid */
40234031
tuple->t_tableOid = InvalidOid;
4024-
HeapTupleSetZeroBase(tuple);
40254032
/* Read in the tuple body */
40264033
LogicalTapeReadExact(state->tapeset, tapenum,
40274034
tuple->t_data, tuple->t_len);

0 commit comments

Comments
 (0)