From: | Jeff Davis <pgsql(at)j-davis(dot)com> |
---|---|
To: | pgsql-hackers(at)postgresql(dot)org |
Cc: | Andres Freund <andres(at)anarazel(dot)de> |
Subject: | Re: AllocSetEstimateChunkSpace() |
Date: | 2020-03-25 18:46:31 |
Message-ID: | b792193cb19cd348e84a5c5b3267a77a6f32edcc.camel@j-davis.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Tue, 2020-03-24 at 18:12 -0700, Jeff Davis wrote:
> I considered making it a method of a memory context, but the planner
> will call this function before the hash agg memory context is
> created.
I implemented this approach also; attached.
It works a little better by having access to the memory context, so it
knows set->allocChunkLimit. It also allows it to work with the slab
allocator, which needs the memory context to return a useful number.
However, this introduces more code and awkwardly needs to use
CurrentMemoryContext when called from the planner (because the actual
memory context we're try to estimate for doesn't exist yet).
I slightly favor the previous approach (mentioned in the parent email)
because it's simple and effective. But I'm fine with this one if
someone thinks it will be better for other use cases.
Regards,
Jeff Davis
Attachment | Content-Type | Size |
---|---|---|
EstimateMemoryChunkSpace.patch | text/x-patch | 10.8 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Tomas Vondra | 2020-03-25 19:05:13 | Re: [HACKERS] advanced partition matching algorithm for partition-wise join |
Previous Message | Anna Akenteva | 2020-03-25 18:10:59 | Re: [HACKERS] make async slave to wait for lsn to be replayed |