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
A vector database stores high-dimensional numeric vectors (typically embeddings) and provides fast similarity search over them, powering use cases like semantic search and retrieval-augmented generation.
query engine →A query engine parses, optimizes, and executes SQL queries against data sources. Learn its core architecture, how it differs from a database, and see examples like DuckDB and Presto.
Massively Parallel Processing (MPP) →Massively Parallel Processing (MPP) is a database architecture in which many independent nodes, each with their own CPU, memory, and storage, cooperate to execute a single query in parallel across a cluster.
Batch processing →Batch processing is the execution of data processing jobs on accumulated groups (batches) of records at scheduled intervals, rather than processing each record as it arrives.
Execution plan →An execution plan is the tree of operators a database will run, in a specific order, to produce the result of a query — the concrete strategy chosen by the query planner and optimizer.
ClickHouse →ClickHouse is an open-source, column-oriented OLAP database built for fast analytical queries over very large datasets.
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.
