Database Kernel (4): Storage — Row Groups, Column Segments and Four Layers
Execution deals in chunks; storage answers a different question: where those chunks live, at what granularity, and how updates and versions fit in. Part four of the plan series: the four-layer in-memory layout. 1. Four layers table └── row group (122,880 rows) └── column data (one column) └── column segment (256 KB block, up to 60 vectors) └── vector (2,048 rows) The numbers are aligned on purpose: 60 × 2,048 = 122,880 — one row group is exactly 60 full vectors; a segment holds up to 60 vectors, about 256 KB; a vector is the smallest read/write unit and the executor’s batch size. Alignment pays off: scans skip whole segments and read whole vectors, with no cross-block stitching. ...