Ardent Performance
ardentperf.com · Personal blog · on HN since 2021
Ardent Performance is a Postgres performance engineer's blog covering benchmarks, incidents, replication, indexing, and database behavior on various systems.
What HN saysHN links it for Postgres topics like the UUID benchmark and logical replica snapshots, and commenters cite it as a source of caution when upgrading large databases.
18HN people shared it
4linked it in comments
25stories submitted
502story points
7 months agolast shared
2021people per year2026
Most-shared posts
- 1UUID Benchmark War4 people · 133 points · first shared 2024 · 82 comments on HN
- 2A Hairy PostgreSQL Incident2 people · 167 points · first shared 2022 · 41 comments on HN
- 3Paranoid SQL Execution on Postgres2 people · 99 points · first shared 2021 · 20 comments on HN
- 4PostgreSQL Performance Puzzle2 people · 4 points · first shared 2022 · discussion on HN
- 5PostgreSQL Logical Replicas and Snapshots: Proceed Carefully2 people · 3 points · first shared 2022 · discussion on HN
- 6Postgres Indexes, Partitioning and LWLock:LockManager Scalability2 people · 2 points · first shared 2024 · discussion on HN
- 7Understanding CPU on AIX Power SMT Systems1 people · 43 points · first shared 2022 · 6 comments on HN
- 8Major Developments in Postgres Extension Discovery and Distribution1 people · 26 points · first shared 2024 · 1 comments on HN
- 9Sanitized SQL1 people · 4 points · first shared 2025 · discussion on HN
- 10PostgreSQL Happiness Hints (2022)1 people · 4 points · first shared 2025 · discussion on HN
- 11Challenges of Postgres Containers1 people · 3 points · first shared 2025 · discussion on HN
- 12Default Sort Order in Db2, SQL Server, Oracle and Postgres 171 people · 3 points · first shared 2024 · discussion on HN
- 13Did Postgres Lose My Data?1 people · 2 points · first shared 2023 · discussion on HN
- 14Postgres IPC:SyncRep – Sync Replication Is Not Actually Sync Replication1 people · 2 points · first shared 2025 · discussion on HN
- 15The Scott Shambaugh Situation Clarifies How Dumb We Are Acting1 people · 2 points · first shared 2026 · discussion on HN
What HN people wrote when they linked it
p2detar · 2025-12-15
Another interesting article from Feb-2024 [0] where the cost of inserting a uuid7() and a bigint is basically the same. To me it wasn't quite clear what the problem with the buffer cache is but the author makes it much more clear than OP's article:
> We need to read blocks from the disk when they are not in the PostgreSQL buffer cache. Conveniently, PostgreSQL makes it very easy to inspect the contents of the buffer cache. This is where the big difference between uuidv4 and uuidv7 becomes clear. Because of the lack of data locality in uuidv4 data, the primary key index is consuming a huge amount of the buffer cache in order to support new data being inserted – and this cache space is no longer available for other indexes and tables, and this significantly slows down the entire workload.
0 - https://ardentperf.com/2024/02/03/uuid-benchmark-war
throw0101a · 2024-02-05
Related on the front page, "UUID Benchmark War":
* https://ardentperf.com/2024/02/03/uuid-benchmark-war/
* https://news.ycombinator.com/item?id=39254871
AlisdairO · 2023-12-13
Indeed - People In The Know have some cocnerns with this approach: https://ardentperf.com/2021/07/26/postgresql-logical-replicas-and-snap… .
At $work we did use this approach to upgrade a large, high throughput PG database, but to mitigate the risk we did a full checksum of the tables. This worked something like:
* Set up logical replica, via 'instacart' approach
* Attach physical replicas to the primary instance and the logical replica, wait for catchup
* (very) briefly pause writes on the primary, and confirm catchup on the physical replicas
* pause log replay on the physical replicas
* resume writes on the primary
* checksum the data in each physical replica, and compare
This approach required <1s write downtime on the primary for a very comprehensive data validation.
ttfkam · 2024-10-21
Contrary to intuition, bigint ends up only 25% smaller on disk than UUIDv7 and no improvement in speed. Honestly in 2024, 32-bit ints are generally a poor fit. Either the table is small enough to be considered a lookup table (16-bit int) or could grow to unknown bounds given enough time (64-bit int). Sequential ids are guessable (which could be a security issue), cannot be generated on the client, and can hinder sharding now that Postgres supports bidirectional replication (multiple writers).
https://ardentperf.com/2024/02/03/uuid-benchmark-war/
My PK preference in descending order: natural key if it makes sense and would speed up queries, 16-bit for unambiguous lookup tables with a hard finite limit of values, UUIDv7, 64-bit sequence, UUIDv4, and then finally 32-bit sequence.
UUIDv7 for performance, reasonable non-guessability, client-generation, and potential for sharding. 64-bit for cases that really need a sequence. UUIDv4 when randomness is required for security. 32-bit when there's a hard finite limit that can guaranteed to be below 2 billion even given the most optimistic of projections.
If the database is small, it doesn't matter. If it's large, it is 99.999% unlikely the primary key will be anything more than a rounding error in storage, access time, or cost. No one ever said, "We would have made payroll if only we had used 32-bit primary keys."
To really save space, extract the timestamp in the UUIDv7 and use an expression index to use as the creation date.…