Re-order pg_attribute columns to eliminate some padding space.
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 23 May 2021 16:12:09 +0000 (12:12 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 23 May 2021 16:12:09 +0000 (12:12 -0400)
commitf5024d8d7b04de2f5f4742ab433cc38160354861
tree7cbd6c5ebc78fb3a1b221b8d28193f6ddc5efb90
parentbc2a389efb3b52d259cefd53c16cfa00742116f2
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
doc/src/sgml/catalogs.sgml
src/backend/access/common/tupdesc.c
src/backend/access/spgist/spgutils.c
src/backend/bootstrap/bootstrap.c
src/backend/catalog/genbki.pl
src/backend/catalog/heap.c
src/backend/catalog/index.c
src/backend/commands/tablecmds.c
src/include/access/spgist_private.h
src/include/catalog/catversion.h
src/include/catalog/pg_attribute.h