From: David Rowley <drowley@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Trim ORDER BY/DISTINCT aggregate pathkeys in gather_grouping_pat
Date: Thu, 14 Mar 2024 22:56:08 +0000
Message-ID: <E1rktzb-003p3b-Ty@gemulon.postgresql.org> (raw)
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(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-committers@postgresql.org
Cc: drowley@postgresql.org, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Trim ORDER BY/DISTINCT aggregate pathkeys in gather_grouping_pat
In-Reply-To: <E1rktzb-003p3b-Ty@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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