# Parallelizing ClickHouse aggregation merge for fixed hash map

DevFeed: [Parallelizing ClickHouse aggregation merge for fixed hash map](<https://devfeed.tech/articles/parallelizing-clickhouse-aggregation-merge-for-fixed-hash-map-5480.md>)

Original publisher: [Read original article](<https://clickhouse.com/blog/parallelizing-fixed-hashmap-aggregation-merge-in-clickhouse>)

Author: Jianfei Hu

Published: 2025-12-16T10:13:14Z

Content type: article

Language: en

Sources: [ClickHouse Blog](<https://devfeed.tech/sources/clickhouse-blog.md>)

Topics: [clickhouse](<https://devfeed.tech/topics/clickhouse.md>), [Concurrency](<https://devfeed.tech/topics/concurrency.md>), [Optimization](<https://devfeed.tech/topics/optimization.md>), [cpu](<https://devfeed.tech/topics/cpu.md>)

Tags: [clickhouse](<https://devfeed.tech/tags/clickhouse.md>), [concurrency](<https://devfeed.tech/tags/concurrency.md>), [deep-dive](<https://devfeed.tech/tags/deep-dive.md>), [engineering](<https://devfeed.tech/tags/engineering.md>), [optimization](<https://devfeed.tech/tags/optimization.md>), [performance](<https://devfeed.tech/tags/performance.md>), [technical](<https://devfeed.tech/tags/technical.md>)

## AI overview

This engineering deep dive explains how ClickHouse parallelized the merge phase of FixedHashMap-based aggregation for small GROUP BY keys. It covers the aggregation internals, an initially ineffective range-segmentation approach, and an in-place design that assigns disjoint key subsets to workers without conversion or race conditions.

## Source excerpt

A first-person engineering deep dive into how ClickHouse parallelized aggregation merges for FixedHashMap, including design choices, false starts, and performance trade-offs.