Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I wonder why the size of the table with uuid7 is smaller than the one with uuid4? Both are using the uuid data type.


As a sibling comment guessed, btree indexes in Postgres can store ordered data much more efficiently than random data. Inserting randomly ordered data leads to fragmentation, with lots of empty space on your index pages.


The main data is the same, it's the primary key which is smaller, presumably a result of the structure of the uuid7 being more regular.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: