Re: PATCH: decreasing memory needlessly consumed by array_agg
От | Jeff Davis |
---|---|
Тема | Re: PATCH: decreasing memory needlessly consumed by array_agg |
Дата | |
Msg-id | CAMp0ubdqh617FjLrxC7dvMfcURB36QC3Gyp=h5iX-SQ-JyjfAw@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: PATCH: decreasing memory needlessly consumed by array_agg (Tomas Vondra <tomas.vondra@2ndquadrant.com>) |
Список | pgsql-hackers |
On Wed, Jan 14, 2015 at 1:52 PM, Tomas Vondra <tomas.vondra@2ndquadrant.com> wrote: > Attached is v8 patch, with a few comments added: > > 1) before initArrayResult() - explaining when it's better to use a > single memory context, and when it's more efficient to use a > separate memory context for each array build state > > 2) before makeArrayResult() - explaining that it won't free memory > when allocated in a single memory context (and that a pfree() > has to be used if necessary) > > 3) before makeMdArrayResult() - explaining that it's illegal to use > release=true unless using a subcontext > I understand there is history to this API, and we need to be compatible, but the end result is awkward. I'm wondering whether it would be better to just have a new set of functions like accumArrayResultElem, etc., and only allow astate=NULL in the original accumArrayResult(). That cure might be worse than the disease though. Regards, Jeff Davis
В списке pgsql-hackers по дате отправления: