![[chap_1_blocks.png]] # Chapter 1: The Building Blocks & The Art of Procrastination Even the laziest elephant needs a place to sit. Before we can start avoiding work with clever indexes or complex query plans, we must understand the physical constraints of our world. Postgres does not store concepts. It stores bytes. And writing bytes to a spinning piece of rust (the hard drive) is exhausting. Therefore, our elephant has developed strict physical rules for how it organizes its environment. The absolute smallest unit of work—a single thought or record—is bundled into a tiny box called a [[Tuple]]. But carrying individual boxes around individually is tedious. To make moving them easier, Postgres crams as many of these tiny boxes as possible into standard-sized shipping containers called [[Page]]s. Because the elephant only has one hand and that hand is exactly 8KB in size, it can never pick up a single record without picking up the entire container it lives in. When you have enough of these containers stacked together, they form a massive, physical warehouse called a [[Table]]. However, reality is often too complex for a lazy being to face directly. When you ask a question, Postgres rarely gives you the entire warehouse. Instead, it constructs a temporary, highly filtered fantasy world called a [[Result Set]] just to show you exactly what you want to see—no more, no less. But the ultimate manifestation of the elephant's procrastination is its refusal to ever throw anything away. When you ask Postgres to delete a record, it doesn't actually walk over, find the box, and take it to the trash. That is too much effort. Instead, it uses a mechanism called [[MVCC|MVCC (Multi-Version Concurrency Control)]]. The elephant simply crosses the old record out with a frantic scribble of a red Sharpie, drops it carelessly on the floor, and promises that its robotic vacuum cleaner (the Autovacuum) will sweep it up eventually.