Re: Optimizing numeric SUM() aggregate

From: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
To: amborodin(at)acm(dot)org
Cc: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Optimizing numeric SUM() aggregate
Date: 2016-07-27 09:40:34
Message-ID: CAEZATCUu8EN0uSeQCQprsX4qVLWniaZ1GK=3OQTLoZSJUAsz+Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 27 July 2016 at 09:57, Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com> wrote:
> it could be
> coded using something like
>
> accum->maxdig += NBASE - 1;
> if (accum->maxdig > (INT_MAX - INT_MAX / NBASE) / (NBASE - 1))
> Propagate carries...
>

Oops, that's not quite right because maxdig is actually epresents the
max possible value divided by NBASE-1 in mul_var(), so actually it
ought to have been accum->maxdig++ in the first line.

Regards,
Dean

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Dean Rasheed 2016-07-27 09:47:16 Re: Optimizing numeric SUM() aggregate
Previous Message Andrew Borodin 2016-07-27 09:17:51 Re: Optimizing numeric SUM() aggregate