pgsql: Save a few bytes in pg_attribute

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема pgsql: Save a few bytes in pg_attribute
Дата
Msg-id E1ph4Wl-0007XL-2y@gemulon.postgresql.org
обсуждение исходный текст
Список 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 по дате отправления:

Предыдущее
От: Peter Geoghegan
Дата:
Сообщение: pgsql: pg_walinspect: Adjust memory context name.
Следующее
От: Jeff Davis
Дата:
Сообщение: pgsql: initdb: emit message when using default ICU locale.