Re: Significant performance issues with array_agg() + HashAggregate plans on Postgres 17

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Scott Carey <scott(dot)carey(at)algonomy(dot)com>, David Rowley <dgrowleyml(at)gmail(dot)com>, pgsql-performance(at)lists(dot)postgresql(dot)org
Subject: Re: Significant performance issues with array_agg() + HashAggregate plans on Postgres 17
Date: 2026-04-03 20:01:38
Message-ID: 973a9511ab3c10d77ee46c4b2cd3bc3210a51550.camel@j-davis.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Fri, 2026-04-03 at 15:56 -0400, Tom Lane wrote:
> Would it make sense to accumulate those values in a separate field
> child_mem_allocated, rather than redefining what mem_allocated
> means?

I think so unless we can't afford the new field for some reason. It
would be convenient to have the single-context-total available when
deleting the context.

I'll try a quick patch. I'll need to be sure that we can properly
decrement the total in all paths.

Regards,
Jeff Davis

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message David Rowley 2026-04-04 00:21:52 Re: Significant performance issues with array_agg() + HashAggregate plans on Postgres 17
Previous Message Tom Lane 2026-04-03 19:56:22 Re: Significant performance issues with array_agg() + HashAggregate plans on Postgres 17