News for hackers. Stuff that matters.
Re:PostgreSQL and UUID as Primary Key by dgb23 on Saturday July 06, 2024 @01:40AM (#40888381)
A uuid is just an uint128, or a byte array of the same size. A DB can use them as fixed size keys just fine, and they convert quickly from/into their string representaion.

The problem is indexing and generation.

For example sqlite already generates sequential ids whether you use them or not.

Non sequential uuids suck for indexing as the table grows. There are some benchmarks and explanations to look up.

The benefit is you can merge aggregates from different DB instances without a fuss. And you can generate uuids without asking your DB.

There are no comments on this comment yet.