Does Bit Column Order Matter in Tables?


At the PGConf.dev, where Postgres developers get together and strategize the work they wanna do for the next version, I attended a session where Matthias van de Meent talked about changing the way Postgres stores columns. As of right now (Postgres 17), columns are aligned in 8-bit intervals, so if you create a table with alternating columns:

MyBitColumn1 – 1 bit used (7 bits wasted for alignment to get to the next byte) SomeOtherColumn – any other datatype, but not a bit MyBitColumn2 – 1 bit used (another 7 bits wasted for alignment)

Matthias pointed out that was