# `HashAgg` on TiDB Server as a Serial Task

![`smart`](HASHAGG09_aa_003_20231013.png)

------------------------------------------------------------------------------
Once the original table scan is complete, multiple intermediate result sets (two in this example) are merged to produce the final result set and calculate the aggregate values. The `HashAgg` operator generates numerous intermediate results, leading to higher memory usage. Thus, it requires careful consideration if memory is limited. Additionally, the entire scan must be completed from the first to the last row before obtaining the final result. For instance, if only the aggregate result for the `Dev.` department is needed, the aggregate result for the `Opt.` department must also be calculated. This process is referred to as blocking. Despite these considerations, the `HashAgg` operator is notable for its speed, as it supports parallel aggregation calculations.
