On Thu, Nov 17, 2011 at 10:07 PM, Greg Matthews
<[email protected]> wrote:
> if (smoothed_alloc <= (float) recent_alloc)
> smoothed_alloc = recent_alloc;
> else if (smoothed_alloc >= 0.00001)
> smoothed_alloc += ((float) recent_alloc - smoothed_alloc) /
> smoothing_samples;
>
I don't think that logic is sound.
Rather,
if (smoothed_alloc <= (float) recent_alloc) {
smoothed_alloc = recent_alloc;
} else {
if (smoothed_alloc < 0.000001)
smoothed_alloc = 0;
smoothed_alloc += ((float) recent_alloc - smoothed_alloc) /
smoothing_samples;
}
--
Sent via pgsql-performance mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance