Over on [1], there's a complaint about a query OOMing because the use
of enable_partitionwise_aggregate caused a plan with 1000 Hash
Aggregate nodes.
The only mention in the docs is the additional memory requirements and
CPU for query planning when that GUC is enabled. There's no mention
that execution could use work_mem * nparts more memory to be used. I
think that's bad and we should fix it.
I've attached my proposal to fix that.
David
[1] https://postgr.es/m/3603c380-d094-136e-e333-610914fb3e80%40gmx.net