Re: Double linking MemoryContext children - Mailing list pgsql-hackers

From Kevin Grittner
Subject Re: Double linking MemoryContext children
Date
Msg-id CACjxUsNBeQ=b5kx7BoQnCJr73Kz_8TpMZU-h7QD2LX5_iKCNJg@mail.gmail.com
Whole thread Raw
In response to Re: Double linking MemoryContext children  (Jim Nasby <Jim.Nasby@BlueTreble.com>)
List pgsql-hackers
On Sun, Dec 6, 2015 at 7:30 PM, Jim Nasby <Jim.Nasby@bluetreble.com> wrote:
> On 9/14/15 7:24 AM, Jan Wieck wrote:
>> On 09/12/2015 11:35 AM, Kevin Grittner wrote:
>>
>>> On the other hand, a grep indicates that there are two places that
>>> MemoryContextData.nextchild is set (and we therefore probably need
>>> to also set the new field), and Jan's proposed patch only changes
>>> one of them.  If we do this, I think we need to change both places
>>> that are affected, so ResourceOwnerCreate() in resowner.c would
>>> need a line or two added.
>>
>> ResourceOwnerCreate() sets ResourceOwnerData.nextchild, not
>> MemoryContextData.nextchild.
>
> Anything ever happen with this? </Momjian-Mode>

Jan was right; the code for operating on resource owners was
similar enough that I mistook it for memory context code in a quick
review of grep results looking for any places that Jan might have
missed.  I went over it all again and couldn't resist adding an
Assert() at one point, but otherwise it looks good.

An optimized build without assertions runs his 20000 statement DO
test in 25646.811 ms without the patch and 2933.754 ms with the
patch.

--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: HELP!!! The WAL Archive is taking up all space
Next
From: "David G. Johnston"
Date:
Subject: Re: HELP!!! The WAL Archive is taking up all space