Storage, Execution & Recovery Internals
Heap, Clustered, and Index-Organized Storage
Physical organization decides where a base row lives and what secondary indexes point to. Heaps favor unconstrained placement, clustered layouts colocate a chosen key range, and index-organized tables make the primary search tree the row store.
- Heap placement minimizes ordering obligations.
- Clustering turns key proximity into page proximity.
- Index-organized leaves are the base records.
- Secondary-index payload follows base identity.
- Only one physical order can dominate.
- Terminology is engine-specific.
| Organization | Base-row location | Secondary entry commonly points to | Workload fit |
|---|---|---|---|
| Heap | Any page with space | RID / tuple locator | Mixed writes; many access paths |
| Clustered table/index | Pages ordered near clustering key | Clustering key or row locator | Frequent ranges on one key |
| Index-organized | Primary-tree leaf | Primary key | Primary-key reads; narrow stable key |