Re: PATCH: decreasing memory needlessly consumed by array_agg
От | Tomas Vondra |
---|---|
Тема | Re: PATCH: decreasing memory needlessly consumed by array_agg |
Дата | |
Msg-id | 54BE76EE.30405@2ndquadrant.com обсуждение исходный текст |
Ответ на | Re: PATCH: decreasing memory needlessly consumed by array_agg (Ali Akbar <the.apaan@gmail.com>) |
Список | pgsql-hackers |
Hi, On 20.1.2015 12:23, Ali Akbar wrote: > 2015-01-20 18:17 GMT+07:00 Ali Akbar <the.apaan@gmail.com > > Sorry, there is another comment of makeMdArrayResult, i suggest also > changing it like this: > @@ -4738,6 +4764,12 @@ makeArrayResult(ArrayBuildState *astate, > * beware: no check that specified dimensions match the number of values > * accumulated. > * > + * beware: if the astate was not initialized within a separate memory > + * context (i.e. using subcontext=true when calling initArrayResult), > + * using release=true is illegal as it releases the whole context, > + * and that may include other memory still used elsewhere (instead use > + * release=false and release the memory with the parent context later) > + * > *astate is working state (must not be NULL) > *rcontext is where to construct result I think both comment fixes are appropriate. I'll wait a bit and then post an updated version of the patch (unless it gets commited with the comment fixes before that). -- Tomas Vondra http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
В списке pgsql-hackers по дате отправления: