| From: | "Matheus Alcantara" <matheusssilv97(at)gmail(dot)com> |
|---|---|
| To: | "Richard Guo" <guofenglinux(at)gmail(dot)com>, "David Rowley" <dgrowleyml(at)gmail(dot)com> |
| Cc: | "Robert Haas" <robertmhaas(at)gmail(dot)com>, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Tender Wang" <tndrwang(at)gmail(dot)com>, "Paul George" <p(dot)a(dot)george19(at)gmail(dot)com>, "Andy Fan" <zhihuifan1213(at)163(dot)com>, "PostgreSQL-development" <pgsql-hackers(at)postgresql(dot)org>, <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
| Subject: | Re: Eager aggregation, take 3 |
| Date: | 2026-04-02 12:18:50 |
| Message-ID: | DHINW6P0RE8W.1SJINOU6VRWV@gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On Mon Mar 30, 2026 at 12:17 AM -03, Richard Guo wrote:
> On Thu, Oct 9, 2025 at 5:07 PM Richard Guo <guofenglinux(at)gmail(dot)com> wrote:
>> I noticed an unnecessary header include in initsplan.c. Will fix that
>> as well.
>
> I noticed a couple of issues that can lead to unexpected results.
> I've attached two patches to fix them.
>
> 1. Eager aggregation was incorrectly checking the data type's default
> collation rather than the expression's actual collation. This allowed
> columns with non-deterministic collations to be pushed down, resulting
> in incorrect grouping. Fixed by 0001.
>
> 2. Pushing aggregates containing volatile functions below a join
> alters their execution count. Fixed by 0002.
>
> (As briefly discussed on Discord, this non-deterministic collation
> issue also exists in our long-existing logic for pushing HAVING down
> to WHERE. But let's fix it for the eager aggregation first.)
>
Hi Richard,
The patches looks good to me and are working as expected. It seems very
straightforward, so I don't have any major comments.
I'm attaching some new tests that I've added to collate.icu.utf8 and
eager_aggregate regression tests during my review, fell free to include
any of them if it could be helpful or none.
--
Matheus Alcantara
EDB: https://www.enterprisedb.com
| Attachment | Content-Type | Size |
|---|---|---|
| more-tests.diff.nocfbot | text/plain | 8.0 KB |
| From | Date | Subject | |
|---|---|---|---|
| Previous Message | Heikki Linnakangas | 2026-04-02 11:52:07 | Re: Shared hash table allocations |