|
|
|
|
|
by avinassh
1221 days ago
|
|
> There are pros and cons to using random IDs as a PK. For RDBMS clustering on the PK (InnoDB), it's a terrible idea. If you're going to sort by the PK, it's usually a terrible idea (UUIDv1 isn't as bad since it includes the timestamp, but that assumes your access pattern is based on insertion time). In which use cases you want to sort by PK? Isn't sorting by fields like created_at sufficient? |
|
Related, PG15 has an improved sort algorithm for some data types. Most integers, timestamps, and a few others. So the column type could matter here.