Unconventional PostgreSQL Optimizations
Creative ideas for speeding up queries in PostgreSQL
UUID Version 4 primary keys in Postgres cause poor performance due to randomness leading to index page splits, fragmentation, excessive IO, and worse cache hit ratios.
They consume more space than integers and lack natural ordering, making inserts, updates, deletes, and lookups inefficient for web app databases. Alternatives like integers, big integers, or time-ordered UUID Version 7 perform better with sequential inserts and compact indexes.