Primary keys in a high-insert table
The measurable difference against v4 appears once the index no longer fits in memory, which is exactly when it is most painful to change.
Generates UUID v7 — time-ordered, sortable identifiers.
Generates UUID v7 — time-ordered, sortable identifiers.
count 1
0197b2a0-...-7...
The leading bits encode a timestamp.
The timestamp prefix makes v7 roughly sortable by creation time.
Your input is sent to YAS infrastructure because the tool requires server-side processing or public network queries. Input is not stored.
curl -X POST "https://yas.sh/api/v1/tools/uuid-v7" \
-H "Content-Type: application/json" \
-d '{"count":1}'const res = await fetch("https://yas.sh/api/v1/tools/uuid-v7", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"count": 1
}),
});
const data = await res.json();import requests
r = requests.post("https://yas.sh/api/v1/tools/uuid-v7", json={"count":1})
data = r.json()| Field | Type | Required | Description |
|---|---|---|---|
| count | integer | No (default 1) | How many (1–50) |
{ "version": 7, "count": 1, "result": "018f...-...-7...-..." }Generate time-ordered (sortable) UUID v7.
400 VALIDATION_ERROR — invalid input or unsupported option.413 PAYLOAD_TOO_LARGE — input exceeds the 64 KB limit.429 RATE_LIMIT_EXCEEDED — rate limit exceeded (60 req/min).UUID version 7, standardised in RFC 9562 in 2024, places a 48-bit Unix millisecond timestamp in the most significant bits, followed by the version and variant nibbles and 74 bits of randomness. It keeps the familiar 36-character UUID text form and fits any UUID column, while making the value time-ordered — the property v4 conspicuously lacks.
Ordering matters because of how B-tree indexes behave. Random v4 keys insert at arbitrary positions, dirtying many pages, splitting nodes and destroying cache locality; on a large table this shows up as write amplification and slower inserts. v7 keys append near the rightmost leaf, so the working set stays small and range queries over recent records become sequential scans.
The measurable difference against v4 appears once the index no longer fits in memory, which is exactly when it is most painful to change.
Time-ordered IDs let you page through events by ID without a secondary timestamp index, and the order is stable.
Records created offline retain approximate creation order once synchronised, without a server round trip to assign identity.
Both are UUIDs, so new rows can use v7 while existing v4 values remain valid — no schema change required.
What this tool deliberately does not do, and where it will disagree with other implementations.