ls lib/duckdb/
DuckDB
DuckDB's aggregation and top-N operators.
- draft How DuckDB runs GROUP BY: vectorised, parallel hash aggregationWhat happens between the table scan and the result of a DuckDB GROUP BY in 2.0.1: vectors of 2,048 values, one partitioned hash table per thread, partitions merged in parallel, and the cases where there is no hash at all.
- draft ORDER BY ... LIMIT in DuckDB: the TOP_N operatorHow DuckDB 2.0.1 answers ORDER BY ... LIMIT n without sorting: a heap of n sort keys per thread, a shared boundary that lets threads and the table scan skip data, the 5,000-row rule for when it sorts anyway, and the optimizer that turns QUALIFY row_number() <= n into the same idea.