3 ms·
> "Use UUIDs instead of integer PKs" is 95% of the time a HORRIBLE idea. As a rule of thumb, if you are a beginner, you should NEVER use a UUID instead of an in
by aianus 10y ago
> "Use UUIDs instead of integer PKs" is 95% of the time a HORRIBLE idea. As a rule of thumb, if you are a beginner, you should NEVER use a UUID instead of an integer PK.
Can you enlighten us as to why? Seems to me if you're not at the scale where you see the benefits of UUIDs you're also not at the scale to see the drawbacks either (bigger, slower indices?).
- balls187 10y agoPoor index performance effects all your queries, regardless of scale. Better more practical advice might be: if you don't need to use a X as a PK, don't use a X as a PK. Where X can be either UUID or BIGINT. If you don't expect your table to scale past a billion rows, INT is more than fine.