Move pg_attribute.attcompression to earlier in struct for reduced size?
Andres Freund <andres@anarazel.de>
From: Andres Freund <andres@anarazel.de>
To: pgsql-hackers@postgresql.org, Dilip Kumar <dilipbalaut@gmail.com>, Robert Haas <robertmhaas@gmail.com>
Date: 2021-05-17T20:48:03Z
Lists: pgsql-hackers
Hi, pg_attribute is one of the biggest table in a new cluster, and often the biggest table in production clusters. Its size is also quite relevant in memory, due to all the TupleDescs we allocate. I just noticed that the new attcompression increased the size not just by 1 byte, but by 4, due to padding. While an increase from 112 to 116 bytes isn't the end of the world, it does seem worth considering using existing unused bytes instead? If we moved attcompression to all the other bool/char fields, we'd avoid that size increase, as there's an existing 2 byte hole. Of course there's the argument that we shouldn't change the column order for existing SELECT * queries, but the existing placement already does (the CATALOG_VARLEN columns follow). Greetings, Andres Freund
Commits
-
Remove forced toast recompression in VACUUM FULL/CLUSTER
- dbab0c07e5ba 14.0 landed
-
Rethink definition of pg_attribute.attcompression.
- e6241d8e030f 14.0 landed
-
Fix memory leak when de-toasting compressed values in VACUUM FULL/CLUSTER
- fb0f5f0172ed 14.0 landed
-
Re-order pg_attribute columns to eliminate some padding space.
- f5024d8d7b04 14.0 landed
-
Add more TAP tests for pg_dump with attribute compression
- 63db0ac3f9e6 14.0 cited