Re: PG 18 release notes draft committed

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: jian he <jian(dot)universality(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: PG 18 release notes draft committed
Date: 2025-05-03 16:56:16
Message-ID: aBZKsM8CKxyKiI7_@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, May 3, 2025 at 11:04:45PM +0800, jian he wrote:
> On Fri, May 2, 2025 at 10:44 AM Bruce Momjian <bruce(at)momjian(dot)us> wrote:
> >
> > I have committd the first draft of the PG 18 release notes. The item
> > count looks strong:
> > release-17: 182
> > release-18: 209
> >
> > I will continue improving it until beta 1, and until the final release.
> > I will probably add markup in 1-3 weeks. Let the feedback begin. ;-)
> >
> > You can see the most current HTML-built version here:
> >
> > https://momjian.us/pgsql_docs/release-18.html
> >
>
> seems you missed this ([1]):
>
> Detect redundant GROUP BY columns using UNIQUE indexes
>
> d4c3a156c added support that when the GROUP BY contained all of the columns
> belonging to a relation's PRIMARY KEY, all other columns belonging to that
> relation would be removed from the GROUP BY clause. That's possible because all
> other columns are functionally dependent on the PRIMARY KEY and those columns
> alone ensure the groups are distinct.
>
> [1] https://git.postgresql.org/cgit/postgresql.git/commit/?id=bd10ec529796a13670645e6acd640c6f290df020

We added this item to the PG 9.6 release notes:

<!--
2016-02-11 [d4c3a156c] Remove GROUP BY columns that are functionally dependent
-->
<para>
Ignore <literal>GROUP BY</> columns that are
functionally dependent on other columns (David Rowley)
</para>

<para>
If a <literal>GROUP BY</> clause includes all columns of a
non-deferred primary key, as well as other columns of the same
table, those other columns are redundant and can be dropped
from the grouping. This saves computation in many common cases.
</para>
</listitem>

Interestingly, the first paragraph suggests this optimization already
works for unique indexes, but the text below it states it only works for
primary keys.

As a nod to PG 9.6, which was released in 2016, I duplicated that item
and reworded it for this commit. :-) Patch attached.

--
Bruce Momjian <bruce(at)momjian(dot)us> https://momjian.us
EDB https://enterprisedb.com

Do not let urgent matters crowd out time for investment in the future.

Attachment Content-Type Size
master.diff text/x-diff 1021 bytes

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2025-05-03 17:23:51 Re: Fix slot synchronization with two_phase decoding enabled
Previous Message Bruce Momjian 2025-05-03 16:19:54 Re: PG 18 release notes draft committed