Storage, Execution & Recovery Internals

Query Lifecycle and Iterator Execution

A query moves from syntax through name/type binding, semantic rewriting and physical planning into an executor tree. In the classic pull iterator model, each parent asks a child for the next tuple, so access, filtering, joining, grouping, and projection compose without materializing every intermediate.
  • Parsing is not semantic validation.
  • Rewrites must preserve observable semantics.
  • Planning chooses executable properties.
  • Pull iterators compose open/next/close.
  • Rescan and parameterization multiply work.
  • Vectorized and push engines change granularity.
Lifecycle and pull-based operator tree
Operator execution properties
OperatorPipeline behaviorKey consequence
Scan/filter/projectUsually streamingEarly selectivity reduces upstream work
Nested loopStreaming but rescans innerTiny estimate miss can multiply cost
Hash join/aggregateBuild/state then outputMemory and spill depend on actual width/rows
SortBlockingStartup latency and external runs
MaterializeStores reusable resultAvoids rescan at memory/temp-I/O cost