Re-order pg_attribute columns to eliminate some padding space.
Tom Lane <tgl@sss.pgh.pa.us>
Re-order pg_attribute columns to eliminate some padding space. Now that attcompression is just a char, there's a lot of wasted padding space after it. Move it into the group of char-wide columns to save a net of 4 bytes per pg_attribute entry. While we're at it, swap the order of attstorage and attalign to make for a more logical grouping of these columns. Also re-order actions in related code to match the new field ordering. This patch also fixes one outright bug: equalTupleDescs() failed to compare attcompression. That could, for example, cause relcache reload to fail to adopt a new value following a change. Michael Paquier and Tom Lane, per a gripe from Andres Freund. Discussion: https://postgr.es/m/20210517204803.iyk5wwvwgtjcmc5w@alap3.anarazel.de
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/catalogs.sgml | modified | +14 −14 |
| src/backend/access/common/tupdesc.c | modified | +11 −5 |
| src/backend/access/spgist/spgutils.c | modified | +2 −2 |
| src/backend/bootstrap/bootstrap.c | modified | +7 −6 |
| src/backend/catalog/genbki.pl | modified | +4 −4 |
| src/backend/catalog/heap.c | modified | +10 −9 |
| src/backend/catalog/index.c | modified | +6 −4 |
| src/backend/commands/tablecmds.c | modified | +12 −16 |
| src/include/access/spgist_private.h | modified | +1 −1 |
| src/include/catalog/catversion.h | modified | +1 −1 |
| src/include/catalog/pg_attribute.h | modified | +11 −11 |
Documentation touched
Discussion
- Move pg_attribute.attcompression to earlier in struct for reduced size? 71 messages · 2021-05-17 → 2021-06-14