Re: Significant performance issues with array_agg() + HashAggregate plans on Postgres 17 - Mailing list pgsql-performance

From Jeff Davis
Subject Re: Significant performance issues with array_agg() + HashAggregate plans on Postgres 17
Date
Msg-id d7e2f7606818c629dbc684575a6c32a2045e0209.camel@j-davis.com
Whole thread Raw
In response to Re: Significant performance issues with array_agg() + HashAggregate plans on Postgres 17  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-performance
On Thu, 2026-04-02 at 18:03 -0400, Tom Lane wrote:

> and a secondary problem is that that drives the
> cost of hash_agg_check_limits to an unacceptable level.

I recall some discussion about whether the memory accounting would
recurse to child contexts at the time MemoryContextGetMemAllocated() is
called, or whether it would update the parent contexts at the time a
new block is allocated in a subcontext. Using the latter strategy would
solve the high cost when there are many subcontexts.

Regards,
    Jeff Davis




pgsql-performance by date:

Previous
From: Tom Lane
Date:
Subject: Re: Significant performance issues with array_agg() + HashAggregate plans on Postgres 17
Next
From: Jeff Davis
Date:
Subject: Re: Significant performance issues with array_agg() + HashAggregate plans on Postgres 17