-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Uid] Add a caution message about using UUIDs as primary keys #19783
Conversation
And for ULIDs ? |
@seb-jean I updated the PR with another caution about ULIDs. Thanks. |
Using UUIDs as primary keys is usually not recommended for performance reasons: | ||
indexes are slower and take more space (because UUIDs in binary format take 128 bits | ||
instead of 32/64 bits for auto-incremental integers) and the non-sequential nature of | ||
UUIDs fragments indexes. UUID v7 is the only variant that solves the fragmentation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WDYT to add anchor link on UUUD v7 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea! I did this while merging. Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UUIDv6 are also fine from a fragmentation PoV
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated the docs here: 2cbc55e Thanks!
58246ac
to
f2de304
Compare
Fixes #19705.