Re: pgsql: Transform OR clauses to ANY expression

Поиск
Список
Период
Сортировка
От Alexander Korotkov
Тема Re: pgsql: Transform OR clauses to ANY expression
Дата
Msg-id CAPpHfduSWL9K5UsSKzTZo-yTgSffg-XsvNR-Z-i3Rw=gGBx-Zw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: pgsql: Transform OR clauses to ANY expression  (Melanie Plageman <melanieplageman@gmail.com>)
Ответы Re: pgsql: Transform OR clauses to ANY expression  (Jelte Fennema-Nio <me@jeltef.nl>)
Список pgsql-committers
On Mon, Apr 8, 2024 at 1:35 AM Melanie Plageman
<melanieplageman@gmail.com> wrote:
> On Sun, Apr 7, 2024 at 6:28 PM Alexander Korotkov
> <akorotkov@postgresql.org> wrote:
> >
> > Transform OR clauses to ANY expression
> >
> > Replace (expr op C1) OR (expr op C2) ... with expr op ANY(ARRAY[C1, C2, ...])
> > on the preliminary stage of optimization when we are still working with the
> > expression tree.
> >
> > Here Cn is a n-th constant expression, 'expr' is non-constant expression, 'op'
> > is an operator which returns boolean result and has a commuter (for the case
> > of reverse order of constant and non-constant parts of the expression,
> > like 'Cn op expr').
> >
> > Sometimes it can lead to not optimal plan.  This is why there is a
> > or_to_any_transform_limit GUC.  It specifies a threshold value of length of
> > arguments in an OR expression that triggers the OR-to-ANY transformation.
> > Generally, more groupable OR arguments mean that transformation will be more
> > likely to win than to lose.
>
> I'm getting this warning now
>
> /src/backend/optimizer/prep/prepqual.c:582:33: warning: declaration of
> ‘lc__state’ shadows a previous local [-Wshadow=compatible-local]
>   582 |                         foreach(lc, entry->consts)

Thank you for catching.  I'm fixing this now.

------
Regards,
Alexander Korotkov



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

Предыдущее
От: Melanie Plageman
Дата:
Сообщение: Re: pgsql: Transform OR clauses to ANY expression
Следующее
От: Alexander Korotkov
Дата:
Сообщение: pgsql: Fix usage of same ListCell transform_or_to_any()'s in nested loo