Unexpected downsides of UUID keys in PostgreSQL
cybertec-postgresql.com
Unexpected downsides of UUID keys in PostgreSQL
1–10 of 215 posts
Re: Unexpected downsides of UUID keys in PostgreSQL
#2Or am I missing something?
Re: Unexpected downsides of UUID keys in PostgreSQL
#3How can this be unexpected? Isn't this what Percona discussed for MySQL already several years ago? Or am I missing something?
Re: Unexpected downsides of UUID keys in PostgreSQL
#4If this isn’t a concern, then using a timestamp based approach as recommended in this article is a good approach. That is the default in MongoDB.
If it is a concern, one approach is to use random UUIDs to give to end users but then internally to have something like auto increment ids.
Re: Unexpected downsides of UUID keys in PostgreSQL
#5Re: Unexpected downsides of UUID keys in PostgreSQL
#6And usually it is still worth it.
Re: Unexpected downsides of UUID keys in PostgreSQL
#7Re: Unexpected downsides of UUID keys in PostgreSQL
#8Re: Unexpected downsides of UUID keys in PostgreSQL
#9Can UUID v7 still be created independently, on a client for instance? Or do they ideally need to be generated in the same place?
Re: Unexpected downsides of UUID keys in PostgreSQL
#10On the topic of how important it is for B-trees to be "orderly": https://news.ycombinator.com/item?id=34404641
PostgreSQL can do (among other types) 32-bit hash indices which work out better for certain use cases. Personally I would avoid B-trees for any UUID unless I really had to do partial or ranged scans on them.