# 1.2 The Shipping Container (The Page)

Suitcases (Tuples) are small, but the Lazy Elephant’s hands are enormous. If the
elephant tried to pick up each suitcase individually, it would be exhausted
before the first query even finished.
To solve this, Postgres crams suitcases into standard-sized **Shipping
Containers** called **Pages**.
## The Standard Size (8KB)
"How curious!" you might exclaim. "Why 8KB? Why not as big as a house, or as small as a mouse?"
In most Postgres universes, every single shipping container is exactly **8KB** in size. This is because the elephant (the storage manager) has a very specific set of **8KB Gloves** that can ONLY grip containers of those exact dimensions. Whether a container is full of suitcases or mostly empty, the elephant always picks up the entire 8KB block. It’s a matter of fashion, you see!
## The Container Layout
If you were to slice a shipping container open, you would see a very clever organization system designed to keep the container balanced, much like a perfectly arranged tea set:
1. **The Captain's Log (The Header):** At the very front of the container is a wobbly control panel (the `PageHeaderData` struct). It records the container's version, a checksum, and strict memory pointers defining the boundaries of the container. Crucially, it also contains the **`pd_lsn`**, which is the exact **Log Sequence Number (LSN)** of the very last diary scribble that modified this container. It’s like a "Last Inspected By" stamp!
2. **The Bungee Hooks (Item Identifiers):** Hanging from the ceiling of the container are a series of numbered hooks called the **Line Pointer Array** (`pd_linp`). Each hook is a tiny 4-byte `ItemIdData` object that points to the exact byte offset of a specific suitcase sitting on the floor. These hooks grow from the front toward the back.
3. **The Suitcases (Tuples):** The actual suitcases are stacked along the floor. They grow from the back toward the front.
4. **The Free Space (The Gap):** In the middle of the container is the **Free Space**. The wobbly control panel uses two pointers to track this vacuum: `pd_lower` (the end of the bungee hooks) and `pd_upper` (the start of the suitcases). The free space is literally just the gap between these two pointers!
When the hooks on the ceiling meet the suitcases on the floor (`pd_lower == pd_upper`), the container is absolutely full! No more luggage can be added until the robotic vacuum cleaner ([[Workloads/Sub/Autovacuum|The Vacuum]]) comes by to clear out any suitcases marked with a "Dead" stamp.
### The Magnifying Glass (`pageinspect`)
If you want to actually peak inside one of these containers, you can use the **`pageinspect` magnifying glass**. This is a special extension that lets the elephant show you the literal binary guts of a page.
```sql
-- First, hire the Magnifying Glass expert
CREATE EXTENSION IF NOT EXISTS pageinspect;
-- Peek at the top-level stats of Page 0 of the 'animals' table
SELECT * FROM page_header(get_raw_page('animals', 0));
-- Results:
-- lsn | checksum | flags | lower | upper | special | pagesize
-- ------------+----------+-------+-------+-------+---------+----------
-- 0/16A5E88 | 0 | 0 | 28 | 8160 | 8192 | 8192
```
In the output above, you can see the **`lsn`** (the last diary entry), the **`pagesize`** (exactly 8192 bytes, or 8KB), and the **`lower`** and **`upper`** pointers that define the Free Space. It’s the ultimate proof that the shipping container is real!
---
[[Chapter 1/1.1 - The Physical Suitcase (The Tuple)|← 1.1 - The Header (HeapTupleHeaderData)]] | [[Chapter 1/1.0 - The Building Blocks of Storage|↑ 1.0 - The Logical vs. The Physical]] | [[Chapter 1/1.3 - The Depot (The Table)|1.3 - The Architectural Permit (DDL) →]]