Back to Devoured - July 23, 2026
DEVOURED
DuckDB Internals: Why is DuckDB Fast? (Part 2 Vectorized Execution)

DuckDB Internals: Why is DuckDB Fast? (Part 2 Vectorized Execution)

Data Greybeam
DuckDB achieves extreme performance by processing data in cache-friendly 'vectors' of 2,048 rows, slashing function-call overhead and maximizing modern CPU cache utilization.
What: DuckDB utilizes a vectorized execution model, selection vectors, and push-based query pipelines to move data in batches rather than row-by-row, minimizing memory copying and interpretation costs.
Why it matters: This shift away from the traditional Volcano-style iteration model (which is row-oriented) is critical for analytical workloads running on modern hardware.
Deep dive
  • Vectorized execution processes data in 2,048-row chunks.
  • Batching reduces the number of function calls and branch mispredictions.
  • Selection vectors allow filtering without physical data copying.
  • Push-based pipelines avoid the overhead of traditional pull-based model interfaces.
  • Memory layout optimization favors cache locality and SIMD processing.
Decoder
  • SIMD (Single Instruction, Multiple Data): CPU instructions that perform the same operation on multiple data points simultaneously.
  • Volcano-style iteration: A classic query execution model where each operator 'pulls' the next row from its child, incurring high overhead for single-row processing.
  • Selection Vector: A list of indices that points to valid rows, allowing operations to skip filtered or invalid data without moving physical memory.
Original article

DuckDB is fast because it processes data in cache-friendly batches of 2,048 rows instead of one row at a time. Its vector formats, selection vectors, precompiled operations, and push-based pipelines reduce copying, function-call overhead, and parallel execution costs.

Explore all 56 articles in today's digest

Fresh dev news, AI-digested daily. Never miss a trend at devoured.fyi