Re: Remove useless GROUP BY columns considering unique index - Mailing list pgsql-hackers

From jian he
Subject Re: Remove useless GROUP BY columns considering unique index
Date
Msg-id CACJufxHPRYVpXsjNKkeu0NYdLnGY7eoB1thtuUiGGrSE4+fz0w@mail.gmail.com
Whole thread Raw
In response to Re: Remove useless GROUP BY columns considering unique index  (David Rowley <dgrowleyml@gmail.com>)
Responses Re: Remove useless GROUP BY columns considering unique index
List pgsql-hackers
On Fri, Nov 29, 2024 at 5:20 PM David Rowley <dgrowleyml@gmail.com> wrote:
>
> The reason I don't think is possible is that we have no infrastructure
> that allows us to tag functions or operators so that non-null input(s)
> mean non-null outputs.  We only have strict, which means null input
> means null output. That's the opposite of what we'd need. It might
> only be possible with a NULLS NOT DISTINCT index.
>
Thank you for pointing out  "non-null input(s)  mean non-null outputs" .
I didn't think about it at all.


regarding v10.
you placed remove_useless_groupby_columns right after add_base_rels_to_query
makes so much sense.
so we can be safely use cached RelOptInfo->indexlist, RelOptInfo->notnullattnums
overall it didn't find any issue.



pgsql-hackers by date:

Previous
From: Andrei Lepikhov
Date:
Subject: Re: Remove useless GROUP BY columns considering unique index
Next
From: Amit Kapila
Date:
Subject: Re: Memory leak in WAL sender with pgoutput (v10~)