Re: Using 128-bit integers for sum, avg and statistics aggregates

Поиск
Список
Период
Сортировка
От Andreas Karlsson
Тема Re: Using 128-bit integers for sum, avg and statistics aggregates
Дата
Msg-id 5503A849.60003@proxel.se
обсуждение исходный текст
Ответ на Re: Using 128-bit integers for sum, avg and statistics aggregates  (Peter Geoghegan <pg@heroku.com>)
Ответы Re: Using 128-bit integers for sum, avg and statistics aggregates  (Petr Jelinek <petr@2ndquadrant.com>)
Список pgsql-hackers
On 03/13/2015 10:22 PM, Peter Geoghegan wrote:
> On Thu, Mar 12, 2015 at 6:23 PM, Andreas Karlsson <andreas@proxel.se> wrote:
>> /*
>>   * Integer data types use Numeric accumulators to share code and avoid risk
>>   * of overflow.  To speed up aggregation 128-bit integer accumulators are
>>   * used instead where sum(X) or sum(X*X) fit into 128-bits, and there is
>>   * platform support.
>>   *
>>   * For int2 and int4 inputs sum(X) will fit into a 64-bit accumulator, hence
>>   * we use faster special-purpose accumulator routines for SUM and AVG of
>>   * these datatypes.
>>   */
>>
>> #ifdef HAVE_INT128
>> typedef struct Int128AggState
>
> Not quite. Refer to the 128-bit integer accumulators as
> "special-purpose accumulator routines" instead. Then, in the case of
> the extant 64-bit accumulators, refer to them by the shorthand
> "integer accumulators". Otherwise it's the wrong way around.

I disagree. The term "integer accumulators" is confusing. Right now I do
not have any better ideas for how to write that comment, so I submit the
next version of the patch with the comment as I wrote it above. Feel
free to come up with a better wording, my English is not always up to
par when writing technical texts.

--
Andreas Karlsson

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Andrew Gierth
Дата:
Сообщение: Re: Re: Abbreviated keys for Datum tuplesort
Следующее
От: Amit Kapila
Дата:
Сообщение: Re: Parallel Seq Scan