Re: Re: Spilling hashed SetOps and aggregates to disk

2018-06-05 Thread Jeff Davis
On Tue, 2018-06-05 at 08:39 -0700, se...@rielau.com wrote: > Strange. We don't see this overeahd and measure a lot more than just > a single metric: Let's investigate again. I wasn't able to repro the overhead on x86; Robert saw it on a POWER machine, and it was somewhat noisy. I don't think we we

RE: Re: Spilling hashed SetOps and aggregates to disk

2018-06-05 Thread serge
Strange. We don't see this overeahd and measure a lot more than just a single metric: Of the grab below only the context->stats += size is need. Could easily be a macro. We also track overall backend size to cap it, and track memory contexts in shared memory (plan cache, function cache, messag

RE: Re: Spilling hashed SetOps and aggregates to disk

2018-06-05 Thread serge
In our code base we have added a WithStats-Flavor for creating memory contexts. This api accepts a pointer to metric for accounting and it is inherited by all subcontexts unless overridden. So we only needed to change context creation API where we wanted (such as TopTansactionContext, Message Con