I added threads to my query engine last week. One flag, --threads 4 , and the scan-bound queries got 1.8 to 2.9x faster. The rest barely moved. That split is the whole story.
The engine is qe, a C++20 columnar engine that reads Parquet through Arrow. A query is a scan plus some operators: filter, aggregate, sort, limit. Single-threaded it wins 3 of 8 benchmark queries against DuckDB and loses 5. The scan was the obvious place to start because that is where the time goes: reading and decompressing Parquet, not the arithmetic after it.
How it works now: each worker thread gets its own Parquet reader and decodes its own row groups. The trick is the output order. Batches still come out in exact serial order, so a query returns the same rows whether you run it with one thread or four. If results depended on the thread count, every test would be a coin flip, and I have 208 of them checked against DuckDB.…