Peter Geoghegan <pg@xxxxxxx> writes: > On Thu, Jul 22, 2021 at 9:21 AM Tom Lane <tgl@xxxxxxxxxxxxx> wrote: >> Yeah, I should have said "2GB plus palloc slop". It doesn't surprise >> me a bit that we seem to be eating another 20% on top of the nominal >> limit. > MAX_KILOBYTES is the max_val for the work_mem GUC itself, and has been > for many years. Right. The point here is that before v13, hash aggregation was not subject to the work_mem limit, nor any related limit. If you did an aggregation requiring more than 2GB-plus-slop, it would work just fine as long as your machine had enough RAM. Now, the performance sucks and there is no knob you can turn to fix it. That's unacceptable in my book. regards, tom lane