← Friday, October 2, 2026DatabasesDeep dive
DuckDB speeds string aggregations by grouping on narrow integer keys
The technique replaces repeated long strings with sorted integer keys for aggregation, then joins the strings back afterward. It is a practical query-design pattern for reducing work on variable-length values.
- What
- DuckDB's dimension-table technique speeds aggregations over long, repeated strings by grouping on narrow integer keys.
- How
- A dimension table maps strings to integers; the query aggregates on those keys and joins the strings back at the end.
- Why it matters
- This can reduce repeated string hashing, copying and comparison in string-heavy analytical queries.
Discussion
Discussion is not switched on yet. Use Note above to keep your own thoughts on this story.
Headline, summary, brief and diagram are written by a model from the source's own text; the link, byline and numbers come from the source. Read the original before relying on a claim.