Re: PATCH: decreasing memory needlessly consumed by array_agg - Mailing list pgsql-hackers

From Jim Nasby
Subject Re: PATCH: decreasing memory needlessly consumed by array_agg
Date
Msg-id 54978590.5000709@BlueTreble.com
Whole thread Raw
In response to Re: PATCH: decreasing memory needlessly consumed by array_agg  (Ali Akbar <the.apaan@gmail.com>)
List pgsql-hackers
On 12/21/14, 7:08 PM, Ali Akbar wrote:
>     Another positive benefit is that this won't break the code unless it
>     uses the new API. This is a problem especially with external code (e.g.
>     extensions), but the new API (initArray*) is not part of 9.4 so there's
>     no such code. So that's nice.
>
>     The one annoying thing is that this makes the API slighly unbalanced.
>     With the new API you can use a shared memory context, which with the old
>     one (not using the initArray* methods) you can't.
>
>     But I'm OK with that, and it makes the patch smaller (15kB -> 11kB).
>
>
> Yes, with this API, we can backpatch this patch to 9.4 (or below) if we need it there.
>
> I think this API is a good compromise of old API and new API. Ideally if we can migrate all code to new API (all code
mustcall initArrayResult* before accumArrayResult*), we can remove parameter MemoryContext rcontext from
accumArrayResult.Currently, the code isn't using the rcontext for anything except for old API calls (in first call to
accumArrayResult).

Until we eliminate the API though, we should leave something in place that still uses the old one, to make certain we
don'taccidentally break it.
 
-- 
Jim Nasby, Data Architect, Blue Treble Consulting
Data in Trouble? Get it in Treble! http://BlueTreble.com



pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: INSERT ... ON CONFLICT {UPDATE | IGNORE}
Next
From: Fabrízio de Royes Mello
Date:
Subject: Re: Proposal "VACUUM SCHEMA"