doc PG 18 relnotes: add GROUP BY column elimination item
authorBruce Momjian <[email protected]>
Sat, 3 May 2025 16:57:18 +0000 (12:57 -0400)
committerBruce Momjian <[email protected]>
Sat, 3 May 2025 16:57:18 +0000 (12:57 -0400)
With a nod to PG 9.6.

Reported-by: jian he
Discussion: https://postgr.es/m/CACJufxEqs=EXZETwtaOooTFhZrtxvSWg8M2uPfzjNtS3wQ6Dzw@mail.gmail.com

doc/src/sgml/release-18.sgml

index 66cdeb67961b33b9d135d71d95f75da871ad6c94..33e9199d758a6634da38cbf02329f4863738b8a7 100644 (file)
@@ -284,6 +284,23 @@ This optimization can be disabled using enable_distinct_reordering.
 </para>
 </listitem>
 
+<!--
+Author: David Rowley <[email protected]>
+2024-12-12 [bd10ec529] Detect redundant GROUP BY columns using UNIQUE indexes
+-->
+
+<listitem>
+<para>
+Ignore GROUP BY columns that are functionally dependent on other columns (Zhang Mingli, Jian He, David Rowley)
+<ulink url="&commit_baseurl;bd10ec529">&sect;</ulink>
+</para>
+
+<para>
+If a GROUP BY clause includes all columns of a unique index, as well as other columns of the same table, those other columns are redundant and can be dropped
+from the grouping.  This was already true for non-deferred primary keys.
+</para>
+</listitem>
+
 <!--
 Author: Richard Guo <[email protected]>
 2024-10-09 [67a54b9e8] Allow pushdown of HAVING clauses with grouping sets