Skip to content

Instantly share code, notes, and snippets.

@mdoering
Created November 15, 2019 12:02
Show Gist options
  • Save mdoering/4bb487cc72b7463f08553fa32e3bf576 to your computer and use it in GitHub Desktop.
Save mdoering/4bb487cc72b7463f08553fa32e3bf576 to your computer and use it in GitHub Desktop.
Disk use of int, smallint and enum (10 values) in Postgres11 on OSX and Linux
MAC
table_name | row_estimate | total_bytes | index_bytes | toast_bytes | table_bytes | total | index | toast | table
-------------+--------------+-------------+-------------+-------------+-------------+--------+---------+------------+--------
test-int4 | 5e+06 | 323534848 | 142221312 | 8192 | 181305344 | 309 MB | 136 MB | 8192 bytes | 173 MB
test-int2 | 5e+06 | 323993600 | 142680064 | 8192 | 181305344 | 309 MB | 136 MB | 8192 bytes | 173 MB
test-enum | 5e+06 | 293650432 | 112336896 | 8192 | 181305344 | 280 MB | 107 MB | 8192 bytes | 173 MB
test-int4[] | 4.99999e+06 | 306806784 | 5505024 | 8192 | 301293568 | 293 MB | 5376 kB | 8192 bytes | 287 MB
test-int2[] | 4.99999e+06 | 266493952 | 5505024 | 8192 | 260980736 | 254 MB | 5376 kB | 8192 bytes | 249 MB
test-enum[] | 4.99998e+06 | 346955776 | 5505024 | 8192 | 341442560 | 331 MB | 5376 kB | 8192 bytes | 326 MB
LINUX
table_name | row_estimate | total_bytes | index_bytes | toast_bytes | table_bytes | total | index | toast | table
-------------+--------------+-------------+-------------+-------------+-------------+--------+---------+------------+--------
test-int4 | 4.99999e+06 | 373325824 | 112336896 | 8192 | 260980736 | 356 MB | 107 MB | 8192 bytes | 249 MB
test-int2 | 4.99999e+06 | 373325824 | 112336896 | 8192 | 260980736 | 356 MB | 107 MB | 8192 bytes | 249 MB
test-enum | 4.99999e+06 | 373325824 | 112336896 | 8192 | 260980736 | 356 MB | 107 MB | 8192 bytes | 249 MB
test-int4[] | 4.99998e+06 | 346955776 | 5505024 | 8192 | 341442560 | 331 MB | 5376 kB | 8192 bytes | 326 MB
test-int2[] | 4.99998e+06 | 346955776 | 5505024 | 8192 | 341442560 | 331 MB | 5376 kB | 8192 bytes | 326 MB
test-enum[] | 4.99998e+06 | 346955776 | 5505024 | 8192 | 341442560 | 331 MB | 5376 kB | 8192 bytes | 326 MB
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment