Subject: Re: Eager aggregation, take 3

From: Richard Guo <[email-masked]>
Date: Tue, 5 Mar 2024 14:47:27 +0800

On Mon, Mar 4, 2024 at 7:49 PM Andy Fan <[email-masked]> wrote:

> This is a really helpful and not easy task, even I am not sure when I
> can spend time to study this, I want to say "Thanks for working on
> this!" first and hope we can really progress on this topic. Good luck!

Thanks.  I hope this take can go even further and ultimately find its
way to be committed.

This needs a rebase after dbbca2cf29.  I also revised the commit message
for 0007 and fixed a typo in 0009.

Thanks
Richard

---

From: Richard Guo <[email-masked]>
Date: Tue, 5 Mar 2024 19:19:41 +0800

> for 0007 and fixed a typo in 0009.

Here is another rebase, mainly to make the test cases more stable by
adding ORDER BY clauses to the test queries.  Also fixed more typos in
passing.

Thanks
Richard

---

From: Richard Guo <[email-masked]>
Date: Thu, 21 Mar 2024 18:51:55 +0800

> adding ORDER BY clauses to the test queries.  Also fixed more typos in

This needs another rebase after 97d85be365.  I also addressed several
issues that I identified during self-review, which include:

* In some cases GroupPathExtraData.agg_final_costs, which is the cost of
final aggregation, fails to be calculated.  This can lead to bogus cost
estimation and end up with unexpected plan.

* If the cheapest partially grouped path is generated through eager
aggregation, the number of groups estimated for the final phase will be
different from the number of groups estimated for non-split aggregation.
That is to say, we should not use 'dNumGroups' for the final aggregation
in add_paths_to_grouping_rel().

* It is possible that we may generate dummy grouped join relations, and
that would trigger the Assert in make_grouped_join_rel().

* More typo fixes.

Thanks
Richard

---

From: Richard Guo <[email-masked]>
Date: Wed, 10 Apr 2024 17:42:52 +0800

There is a conflict in the parallel_schedule file.  So here is another
rebase.  Nothing else has changed.

Thanks
Richard