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.
Where the order row lives
OrganizationBase-row locationSecondary entry commonly points toWorkload fit
HeapAny page with spaceRID / tuple locatorMixed writes; many access paths
Clustered table/indexPages ordered near clustering keyClustering key or row locatorFrequent ranges on one key
Index-organizedPrimary-tree leafPrimary keyPrimary-key reads; narrow stable key
Secondary lookup implications