Re: tuplesort memory usage: grow_memtuples

Greg Stark <stark@mit.edu>

From: Greg Stark <stark@mit.edu>
To: Peter Geoghegan <peter@2ndquadrant.com>
Cc: Robert Haas <robertmhaas@gmail.com>, Simon Riggs <simon@2ndquadrant.com>, Jeff Janes <jeff.janes@gmail.com>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2012-11-15T19:54:25Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Incorporate a couple of recent tuplesort.c improvements into tuplestore.c.

On Thu, Nov 15, 2012 at 7:36 PM, Peter Geoghegan <peter@2ndquadrant.com> wrote:
> On 15 November 2012 19:16, Robert Haas <robertmhaas@gmail.com> wrote:
>> So what's next here?  Do you want to work on these issue some more?
>> Or does Jeff?  I'd like to see this go in, but I'm not sure I have the
>> bandwidth to do the legwork myself.
>
> I'll take another look. No elegant solution immediately occurs to me, though.

The overflow was trivial to fix.

The only concern I had was about the behaviour after it did the
special case. I didn't want it to keep doing the math and trying to
grow again a little bit every tuple. I think I was leaning to putting
the magic flag back. The alternative is to only do the one-off grow if
we can grow at least some arbitrary percentage like 10% or something
like that. But it seems like a lot of arithmetic to be doing each time
around for probably no gain.


-- 
greg