3 ms·
Sortable primarily keys matters very much for any DB clustering on them, e.g. MySQL/InnoDB and SQL Server. It also matters, albeit to a much lesser extent, to
by sgarland 3y ago
Sortable primarily keys matters very much for any DB clustering on them, e.g. MySQL/InnoDB and SQL Server.
It also matters, albeit to a much lesser extent, to others. Postgres stores tuples in a heap, but the PK is still a B+tree (ish), so an INSERT or UPDATE heavy workload will suffer somewhat.
- hot_gril 3y agoYeah, you're right. But for those, the typical PK recommendation of bigserial is already time-ordered and mostly packed.