![[Postgres/assets/chap_1_blocks.png]]
# Chapter 1: The building blocks of storage
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 Logical vs. The Physical
"Hey," you might say, adjusting your huge glasses, "I thought Postgres was all about rows and columns? Like a nice, organized spreadsheet?"
The Lazy Elephant sighs, blowing a peanut hull off its trunk. "Rows are just a bedtime story we tell developers to help them sleep at night. In the real world—the physical world—we don't have rows. We have **Tuples**."
It is important to understand that a **Tuple is physical**, but a **Row is logical**.
When you think about your data, you think in **Rows**—the beautiful, clean ideas of information. But when the elephant looks at the warehouse floor, it sees **Tuples**—physical suitcases that may or may not be current. Because the elephant is too lazy to ever use an eraser, it doesn't "update" a row. It just ignores the old physical suitcase and packs a brand new one. To the elephant, a single logical "Row" might actually be a pile of five different physical "Tuples" sitting in a corner, waiting for a bureaucratic bird to decide which one is currently "real."
## The Hierarchy of Laziness
The elephant organizes its warehouse in a strict hierarchy designed to minimize movement:
1. **[[Postgres/Structures/Tuple]]s (The Suitcases):** The actual record, packed with its header metadata, data, and alignment padding.
2. **[[Postgres/Structures/Page]]s (The Shipping Containers):** Because the elephant only has one hand and that hand is exactly 8KB in size, it can never pick up a single suitcase without picking up the entire 8KB container it lives in.
3. **[[Postgres/Structures/Table]]s (The Warehouse):** A massive stack of containers, often spanning multiple physical files on the disk.
By the time you ask a question (a query), Postgres rarely gives you the entire warehouse. Instead, it constructs a temporary, highly filtered fantasy world called a [[Postgres/Structures/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 [[Postgres/Architecture/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.