Re: v17 Possible Union All Bug
Alexander Korotkov <aekorotkov@gmail.com>
From: Alexander Korotkov <aekorotkov@gmail.com>
To: Andrei Lepikhov <a.lepikhov@postgrespro.ru>
Cc: "David G. Johnston" <david.g.johnston@gmail.com>,
Tom Lane <tgl@sss.pgh.pa.us>, David Rowley <dgrowleyml@gmail.com>,
Alexander Korotkov <akorotkov@postgresql.org>, PostgreSQL Bug List <pgsql-bugs@lists.postgresql.org>,
Richard Guo <guofenglinux@gmail.com>
Date: 2024-02-07T09:28:32Z
Lists: pgsql-bugs
Attachments
- 0001-Fix-usage-of-aggregate-pathkeys-in-group_keys_reo-v1.patch (application/octet-stream) patch v1-0001
On Sun, Feb 4, 2024 at 6:57 AM Andrei Lepikhov <a.lepikhov@postgrespro.ru> wrote: > The simple fix is in the attachment. But I'm not sure we should fix > GROUP-BY optimization instead of the more general issue. > The source of the problem is root->group_pathkeys, which contains > grouping pathkeys and aggregate pathkeys. For now, their 'sortref' > values could intersect, and we can differ which one references the query > target list and which one the target list of the aggregate. > So, I would like to get advice here: should we make a quick fix here, or > is such a mess in the sortref values not a mess and designed for some > purposes? Thank you, Andrei. I think we should apply this fix for now, while better refactoring could be done in future. I've revised your fix with more comments and a commit message. I'm going to push it if there are no objections. ------ Regards, Alexander Korotkov
Commits
-
Fix usage of aggregate pathkeys in group_keys_reorder_by_pathkeys()
- c01f6ef46c8f 17.0 landed
-
Move is_valid_ascii() to ascii.h.
- 97287bdfae41 17.0 cited
-
Test EXPLAIN (FORMAT JSON) ... XMLTABLE
- 752533d40fd5 17.0 cited
-
Add test module injection_points
- 49cd2b93d7db 17.0 cited
-
Fix table name collision in tests in 0452b461bc
- c03d91d9be37 17.0 cited
-
Explore alternative orderings of group-by pathkeys during optimization.
- 0452b461bc40 17.0 cited
-
Generalize the common code of adding sort before processing of grouping
- 7ab80ac1caf9 17.0 cited
-
Reorder actions in ProcArrayApplyRecoveryInfo()
- c64086b79dba 17.0 cited
-
More documentation updates for incremental backup.
- 7b1dbf0a8d1d 17.0 cited
-
Avoid useless ReplicationOriginExitCleanup locking
- aa817c749657 17.0 cited