Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Pól:

On Fri, May 28, 2021 at 11:36 AM Pól Ua Laoínecháin <linehanp@xxxxxx> 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.






[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux