Re: Partial aggregates pushdown

Поиск
Список
Период
Сортировка
От Alexander Pyhalov
Тема Re: Partial aggregates pushdown
Дата
Msg-id 9a6d8434e2a17d3257e89d608eac795a@postgrespro.ru
обсуждение исходный текст
Ответ на Re: Partial aggregates pushdown  (Zhihong Yu <zyu@yugabyte.com>)
Список pgsql-hackers
Zhihong Yu писал 2021-10-22 00:43:
> Hi,
> w.r.t. 0001-Partial-aggregates-push-down-v03.patch
> 

Hi.

> For partial_agg_ok(),
> 
> +   if (agg->aggdistinct || agg->aggvariadic || agg->aggkind !=
> AGGKIND_NORMAL || agg->aggorder != NIL)
> +       ok = false;
> 
> Since SearchSysCache1() is not called yet, you can return false
> directly.

Fixed.

> 
> +       if (aggform->aggpartialpushdownsafe != true)
> 
> The above can be written as:
> 
>        if (!aggform->aggpartialpushdownsafe)

Fixed.

> 
> For build_conv_list():
> 
> +           Oid         converter_oid = InvalidOid;
> +
> +           if (IsA(tlentry->expr, Aggref))
> 
> ...
> +           }
> +           convlist = lappend_oid(convlist, converter_oid);
> 
> Do you intend to append InvalidOid to convlist (when tlentry->expr is
> not Aggref) ?

Yes, for each tlist member (which matches fpinfo->grouped_tlist in case 
when foreignrel is UPPER_REL) we need to find corresponding converter.
If we don't append InvalidOid, we can't find convlist member, 
corresponding to tlist member. Added comments to build_conv_list.

Also fixed error in pg_dump.c (we selected '0' when 
aggpartialconverterfn was not defined in schema, but checked for '-').

-- 
Best regards,
Alexander Pyhalov,
Postgres Professional
Вложения

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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: Experimenting with hash tables inside pg_dump
Следующее
От: Greg Nancarrow
Дата:
Сообщение: Re: Added schema level support for publication.