Re: pgsql: Fix accounting of memory needed for merge heap. - Mailing list pgsql-committers

From Peter Geoghegan
Subject Re: pgsql: Fix accounting of memory needed for merge heap.
Date
Msg-id CAM3SWZQio_tvp4Ah+WjwCXvGt5HpmbyM0KB5b1w9mTULemHU-w@mail.gmail.com
Whole thread Raw
In response to pgsql: Fix accounting of memory needed for merge heap.  (Heikki Linnakangas <heikki.linnakangas@iki.fi>)
Responses Re: pgsql: Fix accounting of memory needed for merge heap.  (Heikki Linnakangas <hlinnaka@iki.fi>)
Re: [COMMITTERS] pgsql: Fix accounting of memory needed for mergeheap.  (Heikki Linnakangas <hlinnaka@iki.fi>)
List pgsql-committers
On Thu, Dec 8, 2016 at 12:20 AM, Heikki Linnakangas
<heikki.linnakangas@iki.fi> wrote:
> While we're at it, add a safeguard for the case that we are already over
> the limit when allocating the read buffers. That shouldn't happen, but
> better safe than sorry.

I think you should 's/Min/Max/' where the new limit is applied. Also
suggest that the subsequent USEMEM() call have
"state->read_buffer_size * numInputTapes" as its argument, rather than
state->availMem, just to be neat.

Thanks
--
Peter Geoghegan


pgsql-committers by date:

Previous
From: Robert Haas
Date:
Subject: pgsql: Fix bogus comment.
Next
From: Heikki Linnakangas
Date:
Subject: pgsql: Fix thinko in safeguard for negative availMem.