postgresql/src/include/access
David Rowley d8a859d22b Reduce size of CompactAttribute struct to 8 bytes
Previously, this was 16 bytes.  With the use of some bitflags and by
reducing the attcacheoff field size to a 16-bit type, we can halve the
size of the struct.

It's unlikely that caching the offsets for offsets larger than what will
fit in a 16-bit int will help much as the tuple is very likely to have
some non-fixed-width types anyway, the offsets of which we cannot cache.

Shrinking this down to 8 bytes helps by accessing fewer cachelines when
performing tuple deformation.  The fields used there are all fully
fledged fields, which don't require any bitmasking to extract the value
of.  It also helps to more efficiently calculate the address of a
compact_attrs[] element in TupleDesc as the x86 LEA instruction can work
with 8 byte offsets, which allows the element address to be calculated
from the TupleDesc's address in a single instruction using LEA's
concurrent shift and add.

Author: David Rowley <dgrowleyml@gmail.com>
Reviewed-by: Andres Freund <andres@anarazel.de>
Reviewed-by: Álvaro Herrera <alvherre@kurilemu.de>
Discussion: https://postgr.es/m/CAApHDvodSVBj3ypOYbYUCJX%2BNWL%3DVZs63RNBQ_FxB_F%2B6QXF-A%40mail.gmail.com
2026-03-17 15:06:31 +13:00
..
amapi.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
amvalidate.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
attmap.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
attnum.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
brin.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
brin_internal.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
brin_page.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
brin_pageops.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
brin_revmap.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
brin_tuple.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
brin_xlog.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
bufmask.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
clog.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
cmptype.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
commit_ts.h Standardize replication origin naming to use "ReplOrigin". 2026-01-28 11:03:29 -08:00
detoast.h Improve type handling of varlena structures 2026-02-11 07:33:24 +09:00
genam.h Reduce header inclusions via execnodes.h 2026-03-16 14:34:57 +01:00
generic_xlog.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
gin.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
gin_private.h Reduce header inclusions via execnodes.h 2026-03-16 14:34:57 +01:00
gin_tuple.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
ginblock.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
ginxlog.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
gist.h Do not lock in BufferGetLSNAtomic() on archs with 8 byte atomic reads 2026-03-11 19:46:08 +01:00
gist_private.h Move fake LSN infrastructure out of GiST. 2026-03-13 19:38:17 -04:00
gistscan.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
gistxlog.h Move fake LSN infrastructure out of GiST. 2026-03-13 19:38:17 -04:00
hash.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
hash_xlog.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
heapam.h Save vmbuffer in heap-specific scan descriptors for on-access pruning 2026-03-15 11:09:10 -04:00
heapam_xlog.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
heaptoast.h Improve type handling of varlena structures 2026-02-11 07:33:24 +09:00
hio.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
htup.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
htup_details.h Remove HeapTupleheaderSetXminCommitted/Invalid functions 2026-02-09 19:15:20 +01:00
itup.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
multixact.h Remove some unnecessary code from multixact truncation 2026-01-15 13:34:50 +02:00
multixact_internal.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
nbtree.h nbtree: Avoid allocating _bt_search stack. 2026-03-12 13:22:36 -04:00
nbtxlog.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
parallel.h Don't include proc.h in shm_mq.h 2026-02-27 10:53:47 +01:00
printsimple.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
printtup.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
relation.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
reloptions.h Make some use of anonymous unions [reloptions] 2026-01-22 17:04:59 +01:00
relscan.h Stop including {brin,gin}_tuple.h in tuplesort.h 2026-01-12 18:09:49 +01:00
rewriteheap.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
rmgr.h Pre-beta mechanical code beautification. 2022-05-12 15:17:30 -04:00
rmgrdesc_utils.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
rmgrlist.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
sdir.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
sequence.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
session.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
skey.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
slru.h Add callback for I/O error messages in SLRUs 2026-03-13 16:21:06 +02:00
spgist.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
spgist_private.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
spgxlog.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
stratnum.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
subtrans.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
syncscan.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
sysattr.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
table.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
tableam.h Remove table_scan_analyze_next_tuple unneeded parameter OldestXmin 2026-02-26 15:41:53 -05:00
tidstore.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
timeline.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
toast_compression.h Change default value of default_toast_compression to "lz4", take two 2026-03-05 09:24:35 +09:00
toast_helper.h Improve type handling of varlena structures 2026-02-11 07:33:24 +09:00
toast_internals.h Improve type handling of varlena structures 2026-02-11 07:33:24 +09:00
transam.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
tsmapi.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
tupconvert.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
tupdesc.h Reduce size of CompactAttribute struct to 8 bytes 2026-03-17 15:06:31 +13:00
tupdesc_details.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
tupmacs.h Optimize tuple deformation 2026-03-16 11:46:00 +13:00
twophase.h Standardize replication origin naming to use "ReplOrigin". 2026-01-28 11:03:29 -08:00
twophase_rmgr.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
valid.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
visibilitymap.h Prevent restore of incremental backup from bloating VM fork. 2026-03-09 06:45:32 -04:00
visibilitymapdefs.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
xact.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
xlog.h Move fake LSN infrastructure out of GiST. 2026-03-13 19:38:17 -04:00
xlog_internal.h Move fake LSN infrastructure out of GiST. 2026-03-13 19:38:17 -04:00
xlogarchive.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
xlogbackup.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
xlogdefs.h Rename AssertVariableIsOfType to StaticAssertVariableIsOfType 2026-02-03 08:45:24 +01:00
xloginsert.h Move fake LSN infrastructure out of GiST. 2026-03-13 19:38:17 -04:00
xlogprefetcher.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
xlogreader.h Standardize replication origin naming to use "ReplOrigin". 2026-01-28 11:03:29 -08:00
xlogrecord.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
xlogrecovery.h Move definition of XLogRecoveryCtlData to xlogrecovery.h 2026-03-05 12:17:47 +09:00
xlogstats.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
xlogutils.h Update copyright for 2026 2026-01-01 13:24:10 -05:00
xlogwait.h Extend xlogwait infrastructure with write and flush wait types 2026-01-05 19:56:19 +02:00