Making Postgres 42,000x slower because I am unemployed

https://news.ycombinator.com/rss Hits: 9
Summary

Everyone is always wondering how to make Postgres faster, more efficient, etc, but nobody ever thinks about how to make Postgres slower. Now, of course, most of those people are being paid to focus on speed, but I am not (although, if you wanted to change that, let me know). As I was writing a slightly more useful guide, I decided someone needed to try to create a Postgres configuration optimized to process queries as slowly as possible. Why? I am not sure, but this is what came of that thought. The Parameters I can’t make this too easy. This is a Postgres tuning challenge, not a throttle-your-CPU-to-one-megahertz-and-delete-indexes challenge, so all changes must be on parameters in postgresql.conf. Additionally, the database will still need to have the capability to process at least one transaction within a reasonable amount of time—it would be too simple just to grind Postgres to a halt. This is more difficult than it might seem, because Postgres tries to make it as difficult as possible to make decisions this stupid by enforcing limits and minimizing configuration. To measure performance, I will use TPC-C with 128 warehouses as implemented in Benchbase, using 100 connections each attempting to output 10k transactions per second, all being processed by Postgres 19devel (latest as of 7/14/2025) running on a Linux 6.15.6 with a Ryzen 7950x, 32GB of RAM, and a 2TB SSD. Each test will last 120 seconds and will execute twice: first to warm the cache and second to collect measurements. I measured a baseline with everything left to its default in postgresql.conf, except for basic tweaks increasing shared_buffers, work_mem, and the number of worker processes. In that test, I got a nice 7082 TPS. Now, let’s see how much slower Postgres will go. Caching? Nah… One of the ways Postgres can respond to read queries efficiently is through extensive caching. Accessing data from the disk is slow, so whenever Postgres reads a block of data from the disk, it caches that block in RAM...

First seen: 2025-07-27 22:30

Last seen: 2025-07-28 06:31