At least my *simple* test showed that GroupAggregate was better than HashAggregate when performing group-by for 100M records, in #PostgreSQL 13.
- No parallel query: 50s (group), 69s (hash)
- Parallel query: 27s (group), 47s (hash)
Not sure if this is expected results, though...
Conversation
Replying to
The disk usage is maybe a bit weird, but the fact that GroupAgg-that-spills is faster than HashAgg-that-spills is not *that* unusual. Expected when you have many groups to aggregate on, and in cases where sort order can be reused. Maybe in a few other cases, too.
Replying to
Yes. I'm just wondering if I can afford to investigate that deeper and write some tips to the slide I will use this Friday's PostgreSQL Conference Japan...
1
Replying to
Or maybe even tell -hackers. This is a new feature, so the chances of finding a real problem are not very low.

