Re: tuplesort memory usage: grow_memtuples - Mailing list pgsql-hackers

From Simon Riggs
Subject Re: tuplesort memory usage: grow_memtuples
Date
Msg-id CA+U5nMJyDB_uCx6B_Ux3M45siUH6Axbs2L_+F1PY7J2wnL2fQA@mail.gmail.com
Whole thread Raw
In response to Re: tuplesort memory usage: grow_memtuples  (Peter Geoghegan <peter@2ndquadrant.com>)
Responses Re: tuplesort memory usage: grow_memtuples  (Peter Geoghegan <peter@2ndquadrant.com>)
List pgsql-hackers
On 16 October 2012 13:42, Peter Geoghegan <peter@2ndquadrant.com> wrote:
> On 14 October 2012 09:19, Simon Riggs <simon@2ndquadrant.com> wrote:
>> This is a very useful optimisation, for both the low and the high end.
>
> Well, I'm about ready to mark this one "ready for committer". There is
> this outstanding issue in my revision of August 17th, though:
>
> +               /*
> +                * XXX: This feels quite brittle; is there a better principled approach,
> +                * that does not violate modularity?
> +                */
> +               newmemtupsize = (int) floor(oldmemtupsize * allowedMem / memNowUsed);
> +               state->fin_growth = true;
>
> I suppose that I should just recognise that this *is* nothing more
> than a heuristic, and leave it at that.

It's a simple and reasonable heuristic, and a great improvement on the
previous situation.

If you describe in detail that it is a heuristic and why that is
proposed over other approaches that should be sufficient for future
generations to read and understand.

-- Simon Riggs                   http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training & Services



pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: Global Sequences
Next
From: Tom Lane
Date:
Subject: Re: Global Sequences