(no title)
opmac | 5 years ago
Instead just use a sequential integer (or UUID). When you need to expose it publicly, use something like hashids ^.
The main downside to straight UUIDs as primary key, is the B-tree used to store the primary key is larger if using UUIDs which are 16 bytes vs 8 for longs. In this case though the IDs are 8 bytes so this point is moot. Also the data is stored randomly on disk, which will make things like range queries slower if querying by ID (but you probably want a different index for querying anyway).
No comments yet.