1. The Anatomy of PostgreSQL's Row-Store Bottleneck at Scale
PostgreSQL was architected in the late 1980s under the legendary POSTGRES project directed by Michael Stonebraker. Its foundational storage architecture is centered around row-oriented 8KB heap pages. In this design, every table is a collection of pages, and each page contains a page header, an array of item pointers (line pointers), and the physical row tuples stored contiguously from the bottom of the page upward.
For Online Transaction Processing (OLTP)—such as inserting a new user record or retrieving an account balance by primary key—this model is brilliant. A single disk read transfers an entire row containing all user attributes directly into PostgreSQL's shared_buffers cache.
However, modern application workloads have evolved. Today's applications do not merely perform transactional CRUD; they continuously capture audit logs, event telemetry, customer activity, and financial ledger data. When engineering teams run analytical aggregations—such as calculating monthly recurring revenue (MRR), cohort retention, or regional sales totals—the row-oriented heap page model hits three severe physical bottlenecks:
- Massive Read Amplification: If a table has 40 columns and an aggregation query only requires two columns (e.g.
created_atandamount), PostgreSQL must still load all 40 columns off the disk and into memory. This creates a 20× to 30× read amplification penalty. - CPU Cache Inefficiency (The Volcano Iterator): PostgreSQL executes queries using the traditional Volcano iterator model, where each plan node invokes
ExecProcNode()tuple-by-tuple. This causes frequent CPU instruction cache misses and prevents modern CPUs from leveraging SIMD (Single Instruction, Multiple Data) vectorization. - Tuple Bloat and Autovacuum Contention: PostgreSQL uses Multi-Version Concurrency Control (MVCC) without an undo log. Every
UPDATEwrites a completely new tuple to disk, leaving the old tuple as dead space until theVACUUMdaemon scans the table. On heavy write-and-update tables, bloat can easily consume 40% to 60% of total disk space.