pgsql: Save a few bytes in pg_attribute - Mailing list pgsql-committers

From Peter Eisentraut
Subject pgsql: Save a few bytes in pg_attribute
Date
Msg-id E1ph4Wl-0007XL-2y@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Save a few bytes in pg_attribute

Change the columns attndims, attstattarget, and attinhcount from int32
to int16, and reorder a bit.  This saves some space (currently 4
bytes) in pg_attribute and tuple descriptors, which translates into
small performance benefits and/or room for new columns in pg_attribute
needed by future features.

attndims and attinhcount are never realistically used with values
larger than int16.  Just to be sure, add some overflow checks.
attstattarget is currently limited explicitly to 10000.

For consistency, pg_constraint.coninhcount is also changed like
attinhcount.

Discussion: https://www.postgresql.org/message-id/flat/d07ffc2b-e0e8-77f7-38fb-be921dff71af%40enterprisedb.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/90189eefc1e11822794e3386d9bafafd3ba3a6e8

Modified Files
--------------
doc/src/sgml/catalogs.sgml          | 60 ++++++++++++++++++-------------------
src/backend/access/common/tupdesc.c |  8 +++++
src/backend/catalog/heap.c          | 11 +++++--
src/backend/catalog/index.c         |  2 +-
src/backend/catalog/pg_constraint.c |  6 +++-
src/backend/commands/tablecmds.c    | 28 +++++++++++++++++
src/include/catalog/catversion.h    |  2 +-
src/include/catalog/pg_attribute.h  | 34 +++++++++++----------
src/include/catalog/pg_constraint.h |  2 +-
9 files changed, 100 insertions(+), 53 deletions(-)


pgsql-committers by date:

Previous
From: Peter Geoghegan
Date:
Subject: pgsql: pg_walinspect: Adjust memory context name.
Next
From: Jeff Davis
Date:
Subject: pgsql: initdb: emit message when using default ICU locale.