Re: Infinite Interval

Поиск
Список
Период
Сортировка
От Dean Rasheed
Тема Re: Infinite Interval
Дата
Msg-id CAEZATCUJ0xjyQUL7SHKxJ5a+Dm5pjoq-WO3NtkDLi6c76rh58w@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Infinite Interval  (jian he <jian.universality@gmail.com>)
Ответы Re: Infinite Interval  (jian he <jian.universality@gmail.com>)
Список pgsql-hackers
On Sat, 16 Sept 2023 at 01:00, jian he <jian.universality@gmail.com> wrote:
>
> I refactor the avg(interval), sum(interval), so moving aggregate,
> plain aggregate both work with +inf/-inf.
> no performance degradation, in fact, some performance gains.
>

I haven't reviewed this part in any detail yet, but I can confirm that
there are some impressive performance improvements for avg(). However,
for me, sum() seems to be consistently a few percent slower with this
patch.

The introduction of an internal transition state struct seems like a
promising approach, but I think there is more to be gained by
eliminating per-row pallocs, and IntervalAggState's MemoryContext
(interval addition, unlike numeric addition, doesn't require memory
allocation, right?).

Also, this needs to include serialization and deserialization
functions, otherwise these aggregates will no longer be able to use
parallel workers. That makes a big difference to queryE, if the size
of the test data is scaled up.

This comment:

+   int64       N;              /* count of processed numbers */

should be "count of processed intervals".

Regards,
Dean



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

Предыдущее
От: Dean Rasheed
Дата:
Сообщение: Re: CHECK Constraint Deferrable
Следующее
От: Ranier Vilela
Дата:
Сообщение: Re: Standardize type of variable when extending Buffers