Re: Remove useless GROUP BY columns considering unique index
От | Peter Eisentraut |
---|---|
Тема | Re: Remove useless GROUP BY columns considering unique index |
Дата | |
Msg-id | bdd253fc-22c6-4d29-8f0e-79bf47961e67@eisentraut.org обсуждение исходный текст |
Ответ на | Re: Remove useless GROUP BY columns considering unique index (David Rowley <dgrowleyml@gmail.com>) |
Ответы |
Re: Remove useless GROUP BY columns considering unique index
|
Список | pgsql-hackers |
On 12.09.24 03:43, David Rowley wrote: > On Sat, 30 Dec 2023 at 04:05, Zhang Mingli <zmlpostgres@gmail.com> wrote: >> So my patch make it easy: check unique index’s columns, it’s a valid candidate if all of that have NOT NULL constraint. >> And we choose a best one who has the least column numbers in get_min_unique_not_null_attnos(), as the reason: less columnsmean that more group by columns could be removed. > > This patch no longer applies. We no longer catalogue NOT NULL > constraints, which this patch is coded to rely upon. Work is ongoing to revive the patch that catalogs not-null constraints: <https://commitfest.postgresql.org/49/5224/>. This patch should probably wait for that patch at the moment. > (Likely it could just look at pg_attribute.attnotnull instead) That won't work because you can't record dependencies on that. (This is one of the reasons for cataloging not-null constraints as real constraints.)
В списке pgsql-hackers по дате отправления: