# `HashAgg` and `StreamAgg` Comparison

+ `HashAgg` excels in throughput, while `StreamAgg` is optimal for response times
+ If the dataset to be scanned is large, the `HashAgg` is more suitable.
+ The `HashAgg` requires more `TiDB Server` memory compared to the `StreamAgg`.
+ Blocking vs. Non-Blocking
+ Parallel vs. Non-Parallel

------------------------------------------------------------------------------
Here is a summary of the different aggregation methods:

- For quickly obtaining `TopN`, `Max`, or `Min` results, the `StreamAgg` algorithm is effective.
- For faster scanning of large datasets, the `HashAgg` operator is more suitable.
- When the TiDB Server has limited memory or when only specific groups need to be returned, the `StreamAgg` operator is preferable.