Paper · Query Processing

MonetDB/X100: Hyper-Pipelining Query Execution

P. Boncz, M. Zukowski, N. Nes · CIDR · 2005

Vectorised execution: processing batches instead of single tuples to use modern CPUs well.

Summary

Modern CPUs run fastest on tight loops over data that fits in cache. Tuple-at-a-time engines spend most of their time on interpretation overhead, such as function calls per tuple, and make poor use of the CPU. The authors show that on analytical workloads these engines achieve low instructions per cycle.

X100 processes data in vectors: small batches of values from a column, sized to fit in the CPU cache. Operators are built from simple primitives that loop over a vector, which lets the compiler generate efficient code and lets the CPU pipeline instructions well. Interpretation overhead is paid once per vector instead of once per tuple.

Vectorised execution became the design of Vectorwise and has since been adopted by many analytical engines, including DuckDB. It is one of the two main answers, along with query compilation, to the cost of the iterator model.

Key ideas

  • Tuple-at-a-time interpretation makes poor use of modern CPUs.
  • Process cache-sized vectors of column values instead of single tuples.
  • Simple, tight loop primitives that compilers and CPUs optimise well.
  • Interpretation overhead amortised across each vector.

More Query Processing papers