Faster String Aggregations with Dimension Tables
When a query groups on long, repeated strings, move the strings into a small dimension table with sorted, narrow integer keys. Aggregate on the keys, then join the strings back in at the very end. The query works as before, though on small fixed-width integers instead of variable-length text.
Sources
- T1Faster String Aggregations with Dimension TablesDatabricks / ClickHouse / DuckDB / Supabase / Neon / PlanetScale