Database / DuckDB Interview questions
What is vectorized query execution in DuckDB?
Vectorized execution processes data in batches, or "vectors," of many values at once (rather than one row at a time), applying each operation to an entire batch before moving to the next stage of the query plan. DuckDB's execution engine is built around this model from the ground up.
This matters for CPU efficiency: operating on a batch of values in a tight loop lets modern CPUs use SIMD instructions and keep data in cache far more effectively than a traditional row-at-a-time (tuple-at-a-time) execution model, where the overhead of function calls and branching per individual row dominates the actual computation cost for simple operations.
DuckDB combines this vectorized model with morsel-driven parallelism, dividing work into small chunks ("morsels") that are dynamically distributed across available CPU threads, which is a large part of why DuckDB can achieve strong single-node analytical performance without needing a distributed cluster for datasets that fit comfortably on one machine.
More Related questions...