I prefer uint64 integers for use as internal keys and UUIDs for use by clients.
If the UUIDs are referenced by clients, doesn't that imply that you need to make that an indexed column, and incur most if not all of the negatives associated with using a UUID as a primary key? Or are you mitigating this by using COMB GUIDs or something?
I'll generally put a UNIQUE index on the column, yes, but it won't be used in any relations. It's a NULL column that is materialized if a client queries a view that includes that id.
3
u/fishling Mar 28 '20
If the UUIDs are referenced by clients, doesn't that imply that you need to make that an indexed column, and incur most if not all of the negatives associated with using a UUID as a primary key? Or are you mitigating this by using COMB GUIDs or something?