9 ms·
I wonder why the size of the table with uuid7 is smaller than the one with uuid4? Both are using the uuid data type.
by hans_castorp 3y ago
I wonder why the size of the table with uuid7 is smaller than the one with uuid4? Both are using the uuid data type.
- sparsely 3y agoThe 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.
- uhoh-itsmaciek 3y agoAs 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.