Ask anything about this article
Hi! I've read this article.
What would you like to know?
@farhan

The Hacker News post Postgres isn’t slow, your storage is landed on the front page this morning and instantly split the community. Some readers dismissed it as "just another performance myth", while others started posting their own storage-related horror stories. The truth sits somewhere in the middle: PostgreSQL is a high-performance engine, but it is also brutally honest about the resources it receives. If the underlying disk cannot keep up, the whole system feels sluggish.
Hot take: Most PostgreSQL latency complaints are not about the query planner – they are about the I/O layer you feed it.
PostgreSQL writes every change to the Write-Ahead Log (WAL) before it ever touches the data files. This design guarantees durability, but it also makes the database I/O-bound under most realistic workloads. When you hear "Postgres is slow", the first place to look is not the planner, but the storage stack:
Even a perfectly indexed query can stall for milliseconds waiting for the WAL to be flushed to durable media.
A quick test run on three popular configurations illustrates the point:
| Setup | Device | Avg. WAL fsync latency (ms) | 100k INSERT throughput (rows/s) |
|---|---|---|---|
| A | 7200 RPM HDD | 12.4 | 1,200 |
| B | SATA SSD (500 GB) | 1.8 | 9,800 |
| C | NVMe PCIe (1 TB) | 0.3 | 42,000 |
All three instances ran the same PostgreSQL 15 build, identical schema, and the same max_wal_size. The difference in raw IOPS translates directly into query latency for any write-heavy workload. The numbers are not exotic – they are exactly what you see on many developer laptops and cheap cloud VMs.
Before you start rewriting queries, run these simple checks:
SELECT pg_stat_bgwriter and look at wal_sync_time. High values point to storage.pg_stat_io (Postgres 15+) – it reports bytes read/written per table and per index.iostat or dstat on the host – look for high %util on the disk device.If any of these metrics are out of line with your expectations, the storage layer is the culprit.
Not every workload needs NVMe. Here’s a quick decision matrix:
| Workload | Write intensity | Recommended storage |
|---|---|---|
| OLTP with heavy inserts/updates | High | NVMe or SCM |
| Reporting / analytics (mostly reads) | Moderate | SATA SSD with high read IOPS |
| Archival / infrequent queries | Low | HDD or cheap cloud HDD |
| Mixed dev / test | Variable | SATA SSD, enable %%INLINECODE_6%% |
Key points:
wal_compression on slower media – it reduces WAL size at the cost of CPU.fsync=off only for non-production – it eliminates the sync bottleneck but sacrifices durability.The headline also sparked a side debate about cloud storage. Many developers assume "SSD" on a cloud VM automatically means low latency, but the reality is nuanced:
When evaluating a cloud option, always look at the IOPS guarantee and latency SLA, not just the advertised "SSD".
pg_wal.checkpoint_timeout – longer intervals reduce WAL writes but increase recovery time.wal_sync_time > 5 ms.wal_compression if CPU headroom exists.pgbench) after provisioning.The headline "Postgres isn’t slow, your storage is" is more than a meme; it is a reminder that modern databases are only as fast as the hardware they sit on. Developers love to blame the query planner, but the hard truth is that the WAL flush, disk queue depth, and network latency dominate real-world latency. By treating storage as a first-class citizen in your architecture, you turn vague "Postgres is slow" complaints into concrete, solvable performance improvements.
Takeaway: Before you optimize a single query, make sure your disk can keep up with the WAL. If it can’t, no amount of index wizardry will save you.