This is a particularly concerning issue in ramsey/uuid, though the severity is low, since the worst case scenario is that some UUIDs are out of sort order, but I’d still like to get to the bottom of it.

If you’re able to help debug the issue, please feel free to take a look.

The reports all say the symfony/uid library doesn’t have this problem, which is even more confusing, since I borrowed the monotonicity algorithm from it.

https://github.com/ramsey/uuid/issues/536

#PHP #UUID

Uuid v7 generated in wrong order · Issue #536 · ramsey/uuid

Hello, I came across a strange case where the library generated uuid v7 incorrectly in time. Here example of table id = Uuid::uuid7()->toString() and created_at (server datetime), sorted by id (asc...

GitHub
@ramsey - if the timestamps are generated by MySQL, then aren't they set to the start of the transaction, not to the actual time? So overlapping transactions would explain this...?
@fisharebest It’s not just the database timestamps being out of sync. Some of the dates embedded in the UUIDs are many years into the future.