Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit571dbe4

Browse files
committed
Improve comments for xlog item size #defines.
1 parent5fb00d4 commit571dbe4

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

‎src/include/access/htup.h

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $Id: htup.h,v 1.47 2001/03/22 04:00:27 momjian Exp $
10+
* $Id: htup.h,v 1.48 2001/03/25 22:40:58 tgl Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -83,20 +83,27 @@ typedef HeapTupleHeaderData *HeapTupleHeader;
8383

8484
/*
8585
* All what we need to find changed tuple (18 bytes)
86+
*
87+
* NB: on most machines, sizeof(xl_heaptid) will include some trailing pad
88+
* bytes for alignment. We don't want to store the pad space in the XLOG,
89+
* so use SizeOfHeapTid for space calculations. Similar comments apply for
90+
* the other xl_FOO structs.
8691
*/
8792
typedefstructxl_heaptid
8893
{
8994
RelFileNodenode;
9095
ItemPointerDatatid;/* changed tuple id */
9196
}xl_heaptid;
9297

98+
#defineSizeOfHeapTid(offsetof(xl_heaptid, tid) + SizeOfIptrData)
99+
93100
/* This is what we need to know about delete */
94101
typedefstructxl_heap_delete
95102
{
96103
xl_heaptidtarget;/* deleted tuple id */
97104
}xl_heap_delete;
98105

99-
#defineSizeOfHeapDelete(offsetof(xl_heaptid, tid) +SizeOfIptrData)
106+
#defineSizeOfHeapDelete(offsetof(xl_heap_delete, target) +SizeOfHeapTid)
100107

101108
typedefstructxl_heap_header
102109
{
@@ -115,14 +122,14 @@ typedef struct xl_heap_insert
115122
/* xl_heap_header & TUPLE DATA FOLLOWS AT END OF STRUCT */
116123
}xl_heap_insert;
117124

118-
#defineSizeOfHeapInsert(offsetof(xl_heaptid, tid) +SizeOfIptrData)
125+
#defineSizeOfHeapInsert(offsetof(xl_heap_insert, target) +SizeOfHeapTid)
119126

120127
/* This is what we need to know about update|move */
121128
typedefstructxl_heap_update
122129
{
123130
xl_heaptidtarget;/* deleted tuple id */
124131
ItemPointerDatanewtid;/* new inserted tuple id */
125-
/* NEW TUPLE xl_heap_header (XMIN & XMAX FOR MOVE OP) */
132+
/* NEW TUPLE xl_heap_header (PLUS xmax & xmin IF MOVE OP) */
126133
/* and TUPLE DATA FOLLOWS AT END OF STRUCT */
127134
}xl_heap_update;
128135

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp