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

From Alvaro Herrera
Subject Re: PATCH: decreasing memory needlessly consumed by array_agg
Date
Msg-id 20141221015416.GZ1768@alvh.no-ip.org
Whole thread Raw
In response to Re: PATCH: decreasing memory needlessly consumed by array_agg  (Tomas Vondra <tv@fuzzy.cz>)
Responses Re: PATCH: decreasing memory needlessly consumed by array_agg  (Tomas Vondra <tv@fuzzy.cz>)
List pgsql-hackers
Tomas Vondra wrote:
> Attached is v5 of the patch, fixing an error with releasing a shared
> memory context (invalid flag values in a few calls).

The functions that gain a new argument should get their comment updated,
to explain what the new argument is for.

Also, what is it with this hunk?

> @@ -4768,6 +4770,9 @@ makeMdArrayResult(ArrayBuildState *astate,
>  
>      MemoryContextSwitchTo(oldcontext);
>  
> +    /* we can only release the context if it's a private one. */
> +    // Assert(! (release && !astate->private_cxt));
> +
>      /* Clean up all the junk */
>      if (release)
>          MemoryContextDelete(astate->mcontext);

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: Doing better at HINTing an appropriate column within errorMissingColumn()
Next
From: Amit Kapila
Date:
Subject: Re: Parallel Seq Scan