Re: remove_useless_groupby_columns is too enthusiastic

Поиск
Список
Период
Сортировка
От David Rowley
Тема Re: remove_useless_groupby_columns is too enthusiastic
Дата
Msg-id CAApHDvozVPAYSL6h50YQ9_k3K3-0axYEgBVdr9TAKdRiM0k5hQ@mail.gmail.com
обсуждение исходный текст
Ответ на remove_useless_groupby_columns is too enthusiastic  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Wed, 13 Jul 2022 at 05:31, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> I tried the attached quick-hack patch that just prevents
> remove_useless_groupby_columns from removing anything that
> appears in ORDER BY.  That successfully fixes the complained-of
> case, and it doesn't change any existing regression test results.
> I'm not sure whether there are any cases that it makes significantly
> worse.

In addition to this, we also do a pre-verification step to see if the
ORDER BY has anything in it that the GROUP BY does not?

I don't think there's any harm in removing the GROUP BY item if the
pre-check finds something extra in ORDER BY since
preprocess_groupclause() is going to fail in that case anyway.

David



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Dilip Kumar
Дата:
Сообщение: Re: making relfilenodes 56 bits
Следующее
От: David Rowley
Дата:
Сообщение: Re: PG15 beta1 sort performance regression due to Generation context change