Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
hans_castorp
on Feb 5, 2024
|
parent
|
context
|
favorite
| on:
UUID v7
I wonder why the size of the table with uuid7 is smaller than the one with uuid4? Both are using the uuid data type.
uhoh-itsmaciek
on Feb 5, 2024
|
next
[–]
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.
sparsely
on Feb 5, 2024
|
prev
[–]
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: