Re: [PATCH] Erase the distinctClause if the result is unique by definition

Поиск
Список
Период
Сортировка
От Ashutosh Bapat
Тема Re: [PATCH] Erase the distinctClause if the result is unique by definition
Дата
Msg-id CAExHW5sY+L6iZ=rwnL7n3jET7aNLCNQimvfcS7C+5wmdjmdPiw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [PATCH] Erase the distinctClause if the result is unique by definition  (Andy Fan <zhihui.fan1213@gmail.com>)
Список pgsql-hackers
On Tue, Mar 10, 2020 at 9:12 PM Andy Fan <zhihui.fan1213@gmail.com> wrote:
>
>
> Hi Tom & David & Bapat:
>
> Thanks for your review so far.  I want to summarize the current issues to help
> our following discussion.
>
> 1. Shall we bypass the AggNode as well with the same logic.
>
> I think yes, since the rules to bypass a AggNode and UniqueNode is exactly same.
> The difficulty of bypassing AggNode is the current aggregation function call is closely
> coupled with AggNode.  In the past few days, I have make the aggregation call can
> run without AggNode (at least I tested sum(without finalized  fn),  avg (with finalized fn)).
> But there are a few things to do, like acl check,  anynull check and maybe more check.
> also there are some MemoryContext mess up need to fix.
> I still need some time for this goal,  so I think the complex of it deserves another thread
> to discuss it,  any thought?

I think if the relation underlying an Agg node is know to be unique
for given groupByClause, we could safely use AGG_SORTED strategy.
Though the input is not ordered, it's sorted thus for every row Agg
node will combine/finalize the aggregate result.

-- 
Best Wishes,
Ashutosh Bapat



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

Предыдущее
От: Peter Geoghegan
Дата:
Сообщение: Re: Improve search for missing parent downlinks in amcheck
Следующее
От: Ashutosh Bapat
Дата:
Сообщение: Re: [PATCH] Erase the distinctClause if the result is unique by definition