diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2008-10-28 15:51:03 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2008-10-28 15:51:03 +0000 |
commit | d26bf23f344887aecac93e9cd22b1dae64f18c83 (patch) | |
tree | 5c199ea34c21361fc5e8f36e96d106dd39ae3487 /src/include | |
parent | 8ecd5351691210ba5b536cd4c1251ea1fce090bb (diff) | |
download | postgresql-d26bf23f344887aecac93e9cd22b1dae64f18c83.tar.gz postgresql-d26bf23f344887aecac93e9cd22b1dae64f18c83.zip |
Arrange to squeeze out the MINIMAL_TUPLE_PADDING in the tuple representation
written to temp files by tuplesort.c and tuplestore.c. This saves 2 bytes per
row for 32-bit machines, and 6 bytes per row for 64-bit machines, which seems
worth the slight additional uglification of the tuple read/write routines.
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/access/htup.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/include/access/htup.h b/src/include/access/htup.h index 85271c26c3a..0803c1b2c77 100644 --- a/src/include/access/htup.h +++ b/src/include/access/htup.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/access/htup.h,v 1.101 2008/08/11 11:05:11 heikki Exp $ + * $PostgreSQL: pgsql/src/include/access/htup.h,v 1.102 2008/10/28 15:51:03 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -420,11 +420,17 @@ do { \ * * Note that t_hoff is computed the same as in a full tuple, hence it includes * the MINIMAL_TUPLE_OFFSET distance. t_len does not include that, however. + * + * MINIMAL_TUPLE_DATA_OFFSET is the offset to the first useful (non-pad) data + * other than the length word. tuplesort.c and tuplestore.c use this to avoid + * writing the padding to disk. */ #define MINIMAL_TUPLE_OFFSET \ ((offsetof(HeapTupleHeaderData, t_infomask2) - sizeof(uint32)) / MAXIMUM_ALIGNOF * MAXIMUM_ALIGNOF) #define MINIMAL_TUPLE_PADDING \ ((offsetof(HeapTupleHeaderData, t_infomask2) - sizeof(uint32)) % MAXIMUM_ALIGNOF) +#define MINIMAL_TUPLE_DATA_OFFSET \ + offsetof(MinimalTupleData, t_infomask2) typedef struct MinimalTupleData { |