postgres/contrib/amcheck
David Rowley db448ce5ad Optimize alignment calculations in tuple form/deform
Here we convert CompactAttribute.attalign from a char, which is directly
derived from pg_attribute.attalign into a uint8, which stores the number
of bytes to align the column's value by in the tuple.

This allows tuple deformation and tuple size calculations to move away
from using the inefficient att_align_nominal() macro, which manually
checks each TYPALIGN_* char to translate that into the alignment bytes
for the given type.  Effectively, this commit changes those to TYPEALIGN
calls, which are branchless and only perform some simple arithmetic with
some bit-twiddling.

The removed branches were often mispredicted by CPUs, especially so in
real-world tables which often contain a mishmash of different types
with different alignment requirements.

Author: David Rowley
Reviewed-by: Andres Freund, Victor Yegorov
Discussion: https://postgr.es/m/CAApHDvrBztXP3yx=NKNmo3xwFAFhEdyPnvrDg3=M0RhDs+4vYw@mail.gmail.com
2024-12-21 09:43:26 +13:00
..
expected Fix typos and duplicate words 2024-04-18 21:28:07 +02:00
sql Fix typos and duplicate words 2024-04-18 21:28:07 +02:00
t Allow TAP tests to force checksums off when calling init() 2024-10-14 11:25:03 +02:00
.gitignore Add .gitignore to contrib/amcheck. 2017-03-09 22:45:24 -05:00
amcheck--1.1--1.2.sql Allow amcheck to re-find tuples using new search. 2019-03-20 10:41:36 -07:00
amcheck--1.2--1.3.sql Extend amcheck to check heap pages. 2020-10-22 08:44:18 -04:00
amcheck--1.3--1.4.sql Teach contrib/amcheck to check the unique constraint violation 2023-10-28 00:21:23 +03:00
amcheck--1.0--1.1.sql Add amcheck verification of heap relations belonging to btree indexes. 2018-03-31 19:52:01 -07:00
amcheck--1.0.sql
amcheck.control Teach contrib/amcheck to check the unique constraint violation 2023-10-28 00:21:23 +03:00
Makefile amcheck: Distinguish interrupted page deletion from corruption. 2023-10-30 14:46:05 -07:00
meson.build Update copyright for 2024 2024-01-03 20:49:05 -05:00
verify_heapam.c Optimize alignment calculations in tuple form/deform 2024-12-21 09:43:26 +13:00
verify_nbtree.c Remove useless casts to (void *) 2024-11-28 08:27:20 +01:00