Re: pgsql: Fix accounting of memory needed for merge heap.

From: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
To: Peter Geoghegan <pg(at)heroku(dot)com>
Cc: pgsql-committers <pgsql-committers(at)postgresql(dot)org>
Subject: Re: pgsql: Fix accounting of memory needed for merge heap.
Date: 2016-12-08 21:07:13
Message-ID: ac52c586-711a-b171-d107-447dec6cace8@iki.fi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

On 12/08/2016 10:49 PM, Peter Geoghegan wrote:
> On Thu, Dec 8, 2016 at 12:20 AM, Heikki Linnakangas
> <heikki(dot)linnakangas(at)iki(dot)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.

D'oh, you're right, of course. Fixed, thanks for the vigilance!

- Heikki

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Geoghegan 2016-12-08 21:08:21 Re: pgsql: Fix accounting of memory needed for merge heap.
Previous Message Heikki Linnakangas 2016-12-08 21:06:38 pgsql: Fix thinko in safeguard for negative availMem.