Re: Remove useless GROUP BY columns considering unique index

David Rowley <dgrowleyml@gmail.com>

From: David Rowley <dgrowleyml@gmail.com>
To: Andrei Lepikhov <lepihov@gmail.com>
Cc: Zhang Mingli <zmlpostgres@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, jian he <jian.universality@gmail.com>
Date: 2024-11-29T07:28:59Z
Lists: pgsql-hackers

Attachments

On Fri, 29 Nov 2024 at 19:36, Andrei Lepikhov <lepihov@gmail.com> wrote:
> 1. Thread reference in the patch comment doesn't work.
> 2. May it be possible to move remove_useless_groupby_columns in the
> second commit? It would be easier to review the differences.

For #1, I rewrote the commit message.

I've split into two patches for ease of review. See attached.

David

Commits

  1. Detect redundant GROUP BY columns using UNIQUE indexes

  2. Defer remove_useless_groupby_columns() work until query_planner()