In this lesson, you will learn how databases organize raw data into fixed-size containers called "pages" to make disk access efficient.
The Problem: Disk Hardware
Hard drives and SSDs are not very good at reading single bytes of information. When you ask a database for a specific row, it doesn’t fetch just those few bytes; it fetches a large, uniform block of data. If the database had to track the location of every individual row across your entire storage drive, the overhead would be astronomical. To solve this, databases use pages.
What is a Page?
A page is the fundamental unit of storage, usually between 4KB and 16KB in size. Think of your database file as a giant book. If each row of data is a single sentence, a "page" is a physical sheet of paper. You cannot read just one word from a page; you have to pick up the whole sheet to look at it.
A typical page structure looks like this:
[ Page Header ] <-- Metadata (ID, free space pointers, checksums)
[ Slot Array ] <-- An index pointing to where rows start in this page
[ Row Data ] <-- The actual records stored sequentially
[ Free Space ] <-- The gap available for new inserts
Why Does This Matter?
When you perform a query, the database engine calculates which pages contain your target rows. It then loads those specific pages into memory (the "Buffer Pool").
If your data is poorly organized—or if your pages are fragmented—the database has to perform "Random I/O," which means fetching many different pages to find just a few rows. By understanding that data is partitioned into these fixed-size blocks, you can better appreciate why features like Fill Factor or Clustered Indexes are so critical: they dictate how tightly rows are packed into these physical pages. If you pack a page too tightly, inserts become expensive because the database must split the page into two to make room; if you leave it too empty, you waste precious memory and disk bandwidth.
Key Takeaway: Databases partition all data into fixed-size blocks called pages, and query performance relies on minimizing the number of pages the system must load from disk to satisfy a request.