pgsql: Adjust reltarget assignment for UPPERREL_PARTIAL_DISTINCT rel

From: David Rowley <drowley(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Adjust reltarget assignment for UPPERREL_PARTIAL_DISTINCT rel
Date: 2024-02-07 08:22:53
Message-ID: E1rXdCn-0053NB-Rn@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Adjust reltarget assignment for UPPERREL_PARTIAL_DISTINCT rel

A comment in grouping_planner() claimed that the PlannerInfo
upper_targets array was not used in core code. However, the code that
generated the paths for the UPPERREL_PARTIAL_DISTINCT rel made that
comment untrue.

Here we adjust the create_distinct_paths() function signature to pass
down the PathTarget the same as is done for create_grouping_paths(),
thus making the aforementioned comment true again.

In passing adjust the order of the upper_targets[] assignments. These
seem to be following the reverse enum order apart from
UPPERREL_PARTIAL_DISTINCT.

Also, update the header comment for generate_gather_paths() to mention
the function is also used to create gather paths for partial distinct
paths.

Author: Richard Guo, David Rowley
Discussion: https://postgr.es/m/CAMbWs48u9VoVOouJsys1qOaC9WVGVmBa+wT1dx8KvxF5GPzezA@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/902900b308fb38543b95526b1f384bf3cce2f514

Modified Files
--------------
src/backend/optimizer/path/allpaths.c | 8 ++++----
src/backend/optimizer/plan/planner.c | 22 ++++++++++++++--------
2 files changed, 18 insertions(+), 12 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Alvaro Herrera 2024-02-07 10:13:24 Re: pgsql: Add EXPLAIN (MEMORY) to report planner memory consumption
Previous Message Amit Kapila 2024-02-07 05:58:36 pgsql: Set LSN for wbuf in _hash_freeovflpage() iff wbuf is modified.