pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Trim ORDER BY/DISTINCT aggregate pathkeys in gather_grouping_pat
2+ messages / 1 participants
[nested] [flat]

* pgsql: Trim ORDER BY/DISTINCT aggregate pathkeys in gather_grouping_pat
@ 2024-03-14 22:55 David Rowley <drowley@postgresql.org>
  0 siblings, 0 replies; 2+ messages in thread

From: David Rowley @ 2024-03-14 22:55 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Trim ORDER BY/DISTINCT aggregate pathkeys in gather_grouping_paths

Similar to d8a295389, trim off any PathKeys which are for ORDER BY /
DISTINCT aggregate functions from the PathKey List for the Gather Merge
paths created by gather_grouping_paths().  These additional PathKeys are
not valid to use after grouping has taken place as these PathKeys belong
to columns which are inputs to an aggregate function and, therefore are
unavailable after aggregation.

Reported-by: Alexander Lakhin
Discussion: https://postgr.es/m/cf63174c-8c89-3953-cb49-48f41f74941a@gmail.com
Backpatch-through: 16, where 1349d2790 was added

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/4169850f0b6fc98a5f28d2b0ca4c3a4c1ecf4553

Modified Files
--------------
src/backend/optimizer/plan/planner.c | 19 +++++++++++++++----
1 file changed, 15 insertions(+), 4 deletions(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* pgsql: Trim ORDER BY/DISTINCT aggregate pathkeys in gather_grouping_pat
@ 2024-03-14 22:56 David Rowley <drowley@postgresql.org>
  0 siblings, 0 replies; 2+ messages in thread

From: David Rowley @ 2024-03-14 22:56 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Trim ORDER BY/DISTINCT aggregate pathkeys in gather_grouping_paths

Similar to d8a295389, trim off any PathKeys which are for ORDER BY /
DISTINCT aggregate functions from the PathKey List for the Gather Merge
paths created by gather_grouping_paths().  These additional PathKeys are
not valid to use after grouping has taken place as these PathKeys belong
to columns which are inputs to an aggregate function and, therefore are
unavailable after aggregation.

Reported-by: Alexander Lakhin
Discussion: https://postgr.es/m/cf63174c-8c89-3953-cb49-48f41f74941a@gmail.com
Backpatch-through: 16, where 1349d2790 was added

Branch
------
REL_16_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/4e1ff2aadefbfbf798a4d318514ac85b2fbdc5aa

Modified Files
--------------
src/backend/optimizer/plan/planner.c | 27 +++++++++++++++++++--------
1 file changed, 19 insertions(+), 8 deletions(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2024-03-14 22:56 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-03-14 22:55 pgsql: Trim ORDER BY/DISTINCT aggregate pathkeys in gather_grouping_pat David Rowley <drowley@postgresql.org>
2024-03-14 22:56 pgsql: Trim ORDER BY/DISTINCT aggregate pathkeys in gather_grouping_pat David Rowley <drowley@postgresql.org>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox