Date: 19 March 2026 • Topic: Database / Performance
When building scalable applications, we often reach for UUIDs over auto-incrementing integers. UUIDv4 has been the standard choice for a long time, generating purely random identifiers. However, this randomness introduces a significant problem: database indexing inefficiency.
Because UUIDv4 values are scattered and completely random, inserting them as primary keys in B-tree indexes (like MySQL's InnoDB uses) causes page splits and heavy disk fragmentation. This degrades write performance considerably as the table grows.
UUIDv7 natively incorporates a UNIX timestamp (to the millisecond) into the beginning of the identifier. The remainder is filled with random bytes. This means that UUIDv7s are naturally sortable by creation time and are inserted sequentially.
created_at column for certain high-volume tables, saving storage space while still maintaining chronologically sortable data.Laravel provides great native support for generating UUIDs. You can easily use Laravel's default model traits like HasUuids to start generating v7 identifiers seamlessly.