| From: | Keyerror Smart <smartkeyerror(at)gmail(dot)com> |
|---|---|
| To: | assam258(at)gmail(dot)com |
| Cc: | pgsql-hackers(at)lists(dot)postgresql(dot)org |
| Subject: | Re: [PATCH] Consider window functions when reordering GROUP BY items |
| Date: | 2026-11-13 05:53:32 |
| Message-ID: | CAD=-kXYup2AM12LCHVm-PkhfJo=ECVi+SrmW6uCmY8gXKpv1PQ@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
Hi Henson,
Thanks for the thorough review and the +1. v5 is attached.
I took the enable_group_by_reordering checks in
count_common_leading_group_pathkeys() and adjust_group_pathkeys_to_input()
and all the new tests from your v4-0003, folded into 0001 and 0002. With
only 0001 applied, make check passes too.
For now I kept the operator guard and its tests. On master, such an
operator class fails only when the query asks for DESC, and then it is the
parser's "could not identify an ordering operator". With 0001 and without
the guard, your eager aggregation query fails with "missing operator"
although it has no DESC at all, and master runs it fine. So this failure
comes from 0001.
Could you share the merge join query that still fails on v4? I tried a
merge join over a backward index scan with the same operator class, and it
worked both on master and with v4-0003. If your query also fails on master,
the guard can't make things consistent and I'm fine dropping it. If not,
maybe it is better to check the operator once in
count_common_leading_group_pathkeys(), so that such pathkeys are not kept.
Either way, I agree it is the committers' decision.
Regards,
Zhenglong Li
| Attachment | Content-Type | Size |
|---|---|---|
| v5-0001-Ignore-sort-direction-when-matching-GROUP-BY-keys.patch | application/octet-stream | 45.0 KB |
| v5-0002-Consider-window-functions-when-reordering-GROUP-B.patch | application/octet-stream | 48.8 KB |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Michael Paquier | 2026-11-13 06:09:03 | Re: Add wait events for server logging destination writes |
| Previous Message | Amit Kapila | 2026-11-13 04:57:47 | Re: Crashes on a partition whose concurrent detach never finished |