Re: Size on disk of INT and BIGINT - not sure I'm getting it?

Поиск
Список
Период
Сортировка
От Francisco Olarte
Тема Re: Size on disk of INT and BIGINT - not sure I'm getting it?
Дата
Msg-id CA+bJJbwinTdGBs1yWOdb8G6=Cp07Ek4RZN8_KJcuHxRMZ8vaCw@mail.gmail.com
обсуждение исходный текст
Ответ на Size on disk of INT and BIGINT - not sure I'm getting it?  (Pól Ua Laoínecháin <linehanp@tcd.ie>)
Список pgsql-general
Pól:

On Fri, May 28, 2021 at 11:36 AM Pól Ua Laoínecháin <linehanp@tcd.ie> wrote:
> BIGINTEGER and INTEGER tables the same size? Comparing tables of 100M records.
...
> test=# CREATE TABLE big_int (x BIGINT NOT NULL);
> test=# CREATE TABLE int_32 (y INT);
Bear in mind a row has more data than just the fields ( thingx like
xmin,xmax and some others ) and there are alignment issues, and other
things.

If, for example, the whole row needs to be 8-byte aligned on a
synthetic example with a single field the rows may be the same lengths
for both cases, note how your tables ocupy
3458Mb but the data is just 800/400 Mb.

You may want to investgate putting some more realistic data ( i.e.,
try 2/4/8 fields per row ) to gain some insight, and reading
https://www.postgresql.org/docs/current/storage-page-layout.html which
gives some pointers on where to go next.

Francisco Olarte.



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

Предыдущее
От: Pól Ua Laoínecháin
Дата:
Сообщение: Size on disk of INT and BIGINT - not sure I'm getting it?
Следующее
От: Laura Smith
Дата:
Сообщение: Modelling versioning in Postgres