Re: Unexpected table size usage for small composite arrays

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: Unexpected table size usage for small composite arrays
Дата
Msg-id CAKFQuwa32sJfr+OUrFX8VpfkoNXdRidK93RmLExz_4s-demBrA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Unexpected table size usage for small composite arrays  (Erik Sjoblom <sjoblom65@gmail.com>)
Список pgsql-hackers
On Tue, Oct 22, 2024 at 3:46 PM Erik Sjoblom <sjoblom65@gmail.com> wrote:

Yes, I did expect that the first element should take 24+12 bytes and let's round that to 50 bytes.

Assuming the 24 is coming from the array overhead you are expecting that storing a custom composite typed value takes zero overhead.  That is a faulty assumption.  A user created custom type always takes some overhead because it is considered a variable structure, even in the case where all of its fields are fixed-width.  Furthermore, it is self-describing, and so that description has to go somewhere.  Therefore, there must be a non-zero per-element overhead to store composite values within an array.  As Tom told you, the specific non-zero number is 24 bytes.

David J.

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