What 1.2 Billion Updates Do to PostgreSQL

Jim Walker

Jim Walker

Chief Product Officer

When an agent works through a task, it rarely writes a tidy little row and moves on. It typically carries context, conversation history, and intermediate results, and it updates that state over and over as it iterates. In practice, that means rows in the 10KB range can get rewritten constantly, often in the same transaction as the operational data the agent is acting on.

That’s an awkward fit for PostgreSQL. Rows that big don’t fit on a standard 8KB page, so PostgreSQL moves the overflow into a separate storage area called TOAST. That works fine on a fresh table. Our engineering team wanted to see what happens once the table has been through a lot of use, so they loaded 30 million 10KB rows into both databases and updated them 1.2 billion times. By the end, a full scan on PostgreSQL took 25x longer than on RegattaDB, which was running close to where it started.

The results: RegattaDB v PostgreSQL

Here’s how the two databases compared at each stage. Full setup, hardware, and methodology are in the long-form post.

Insertion: 8.6x faster

  • RegattaDB: 196,068 rows/sec. Writes once, directly to its log-structured store.
  • PostgreSQL: 22,924 rows/sec, best-tuned. Writes every row twice, once to the WAL and once to the heap.

Full scan, fresh table: 2.7x faster

  • RegattaDB: 50 seconds. Reads each row in one pass.
  • PostgreSQL: 136 seconds. Fetches each row from the heap, then chases down its TOASTed columns separately. Both saturated the same disk.

Full scan after 1.2 billion updates: 25x faster

  • RegattaDB: 59 seconds. Barely moved from its fresh-table baseline of 50 seconds.
  • PostgreSQL: 1,470 seconds (24m 30s). Up from 136 seconds fresh, a 10.8x slowdown against its own baseline.

Storage growth under sustained updates

  • RegattaDB: stayed about 90% dense, at every concurrency level we tested, up to 512.
  • PostgreSQL: heap file grew 6.3x. At higher concurrency, VACUUM couldn't keep up at all: the heap grew until it overflowed a 1.5TB disk holding about 300GB of actual data, forcing us to throttle concurrency just to finish the test.
Infographic: RegattaDB vs PostgreSQL on 30 million 10KB rows, same hardware. RegattaDB is 8.6x faster at inserts (196,068 vs 22,924 rows/s), 2.7x faster on a full scan of a fresh table (50 s vs 136 s), and 25x faster on a full scan after 1.2 billion updates (59 s vs 1,470 s).

We pushed RegattaDB to 2.4 billion updates to see if the pattern held. It did and scan time stayed flat.

Why it happens

PostgreSQL stores rows on slotted pages and moves anything too large into TOAST. For big rows that don’t change much, that’s a sensible design. The trouble starts with constant updates. Every new row version leaves dead space in the heap, a single row’s TOAST data ends up scattered across the disk, and VACUUM can’t reclaim space as fast as it piles up. Scans slow down because they’re reading far more pages to get the same data.

RegattaDB’s log-structured row store was built with large rows in mind, so it doesn’t need a separate overflow area. Row data is written once instead of going to both the WAL and the table. When old row versions need cleaning up, RegattaDB uses metadata that tracks exactly where they are rather than crawling the whole table.

Storage layout is only one kind of efficiency. RegattaDB also runs OLTP, OLAP, and vector workloads in a single engine, which we’ve written about in The Case for a Single, Distributed Database Under Growing Infrastructure Constraints and What Workloads Can You Converge with RegattaDB?.

Want to dive deeper?

Erez Webman, our CTO, wrote up the full experiment, including setup, methodology, and every phase of the test: When Rows Outgrow the Page: RegattaDB vs. PostgreSQL TOAST. If you’d rather watch, there are 2 short videos, one of the insert and another of the scan run.

Or try RegattaDB yourself.