Save a few bytes in pg_attribute

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Save a few bytes in pg_attribute
Дата
Msg-id d07ffc2b-e0e8-77f7-38fb-be921dff71af@enterprisedb.com
обсуждение исходный текст
Ответы Re: Save a few bytes in pg_attribute  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Save a few bytes in pg_attribute  (David Rowley <dgrowleyml@gmail.com>)
Re: Save a few bytes in pg_attribute  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers
After the discussion in [0] ff., I was looking around in pg_attribute 
and noticed that we could possibly save 4 bytes.  We could change both 
attstattarget and attinhcount from int4 to int2, which together with 
some reordering would save 4 bytes from the fixed portion.

attstattarget is already limited to 10000, so this wouldn't lose 
anything.  For attinhcount, I don't see any documented limits.  But it 
seems unlikely to me that someone would need more than 32k immediate 
inheritance parents on a column.  (Maybe an overflow check would be 
useful, though, to prevent shenanigans.)

The attached patch seems to work.  Thoughts?


[0]: 
https://www.postgresql.org/message-id/20230313204119.4mkepdvixcxrwpsc%40awork3.anarazel.de
Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Sébastien Lardière
Дата:
Сообщение: Re: Timeline ID hexadecimal format
Следующее
От: Tomas Vondra
Дата:
Сообщение: Re: Ignoring BRIN for HOT updates (was: -udpates seems broken)