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

From: Peter Geoghegan <pg(at)heroku(dot)com>
To: Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi>
Cc: pgsql-committers <pgsql-committers(at)postgresql(dot)org>
Subject: Re: pgsql: Fix accounting of memory needed for merge heap.
Date: 2016-12-08 20:49:17
Message-ID: CAM3SWZQio_tvp4Ah+WjwCXvGt5HpmbyM0KB5b1w9mTULemHU-w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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.

Thanks
--
Peter Geoghegan

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Heikki Linnakangas 2016-12-08 21:06:38 pgsql: Fix thinko in safeguard for negative availMem.
Previous Message Robert Haas 2016-12-08 20:04:55 pgsql: Fix bogus comment.