Closed Koff closed 1 year ago
People often mention ID generation as a bottleneck, but from my experience, it's rarely an issue outside of tech giants' scenarios. For my application and ETL processes, the advantages of UUIDs—especially avoiding DB roundtrips for ID generation—outweighed using bigint.
@Koff @krystofbe Thanks for bringing this topic up!
I'm really sorry for taking so long to respond.
I'd say I agree with the fact that unless explicitly needed, one should opt-out of using UUIDs as primary keys, especially if you are using Postgres.
For the sake of simplicity and using the good defaults provided by Django, I'll remove the mention of changing the primary key in that section, not to suade people towards that.
Cheers!
Some feedback about this like:
In Postgres, primary keys as UUIDs much slower in joins, and their indexes are a lot heavier. https://www.cybertec-postgresql.com/en/int4-vs-int8-vs-uuid-vs-numeric-performance-on-bigger-joins/
Primary keys should be an integer, and if needed, a separate UUID column with a unique constraint can be used to offer a customer facing id for an object.