News for hackers. Stuff that matters.
Re:Launch HN: Activepieces (YC S22) – Open-Source Zapier Alt... by avinassh on Thursday February 09, 2023 @12:54PM (#34728170)
> 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?

Re:Launch HN: Activepieces (YC S22) – Open-Source Zapier Alt... by sgarland on Thursday February 09, 2023 @01:19PM (#34728666)
Depends if you're using an autoincrementing int as your PK. If so, it may be a reasonable decision. It may have gaps, of course, but it's still monotonic.

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.