← Back to Glossary

Vectorized execution

Vectorized execution is a query processing model where each operator processes a batch (a "vector") of values at once, instead of one row at a time, to reduce interpretation overhead and better use modern CPUs.

Overview

Traditional query engines built on the "Volcano" or iterator model process one row at a time: each operator's next() call produces a single tuple, and the overhead of function calls and branching is paid once per row. Vectorized execution instead has each operator process a whole batch of rows — a vector — per call, amortizing that per-call overhead across hundreds or thousands of values and letting the CPU execute tight, predictable loops that benefit from SIMD instructions and cache locality.

Vectorized vs. Tuple-at-a-Time

The performance gap between the two models is large for analytical queries. A tuple-at-a-time engine spends much of its time on interpretation overhead unrelated to the actual computation; a vectorized engine spends most of its time doing real work — filtering, aggregating, hashing — on tightly packed arrays of values. This is why essentially every modern analytical database engine (DuckDB, ClickHouse, Snowflake, and others) uses vectorized execution rather than row-at-a-time processing.

DuckDB's Vectorized Engine

DuckDB processes data in vectors of up to STANDARD_VECTOR_SIZE (2048) values by default, passed between operators as columnar batches rather than individual rows. Vectorized execution is paired with morsel-driven parallelism, an approach from the HyPer research system: work is split into small units ("morsels") that idle threads pull from a shared queue, giving natural load balancing across CPU cores without a fixed, upfront work partitioning. Together, columnar storage, vectorized execution, and morsel-driven parallelism are the three pillars that make DuckDB fast on a single machine.

Related terms

FAQS

It processes many values per operator call instead of one, amortizing per-call interpretation overhead and letting the CPU use SIMD instructions and cache-friendly loops over tightly packed batches of data.

DuckDB's default STANDARD_VECTOR_SIZE is 2048 rows per vector.