Re: Remove useless GROUP BY columns considering unique index

From: jian he <jian(dot)universality(at)gmail(dot)com>
To: Andrei Lepikhov <lepihov(at)gmail(dot)com>
Cc: David Rowley <dgrowleyml(at)gmail(dot)com>, Zhang Mingli <zmlpostgres(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Remove useless GROUP BY columns considering unique index
Date: 2024-11-29 07:04:16
Message-ID: CACJufxFX7+bCY5PT6v++OwKECE0iB+kFxJ8rby0TR-wQcfbXYQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Nov 29, 2024 at 2:36 PM Andrei Lepikhov <lepihov(at)gmail(dot)com> wrote:
>
> > I forgot to do a local commit before sending v8. Fixed in the attached v9.
> 1. Thread reference in the patch comment doesn't work.
fixed.

I found that unique expression index can also be used for groupby
column removal.
so I implemented it, aslo added two tests on it.

now remove_useless_groupby_columns like:
if (index->indexprs == NIL)
{
--handle unique index
}
else
{
--handle unique expression index
}

what do you think?

Attachment Content-Type Size
v10-0001-remove-useless-group-by-columns-via-unique-not-n.patch text/x-patch 23.4 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Langote 2024-11-29 07:26:16 Re: doc fail about ALTER TABLE ATTACH re. NO INHERIT
Previous Message Andrei Lepikhov 2024-11-29 06:35:56 Re: Remove useless GROUP BY columns considering unique index