Re: Eval expression R/O once time (src/backend/executor/execExpr.c)

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: Eval expression R/O once time (src/backend/executor/execExpr.c)
Дата
Msg-id 20210921230055.sbdfdli6myiimxvm@alap3.anarazel.de
обсуждение исходный текст
Ответ на Re: Eval expression R/O once time (src/backend/executor/execExpr.c)  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Eval expression R/O once time (src/backend/executor/execExpr.c)  (Ranier Vilela <ranier.vf@gmail.com>)
Список pgsql-hackers
Hi,

On 2021-09-21 18:21:24 -0400, Tom Lane wrote:
> Andres Freund <andres@anarazel.de> writes:
> > On 2021-09-21 15:09:11 -0300, Ranier Vilela wrote:
> >> Currently when determining where CoerceToDomainValue can be read,
> >> it evaluates every step in a loop.
> >> But, I think that the expression is immutable and should be solved only
> >> once.
> 
> > What is immutable here?
> 
> I think Ranier has a point here.  The clear intent of this bit:
> 
>                 /*
>                  * If first time through, determine where CoerceToDomainValue
>                  * nodes should read from.
>                  */
>                 if (domainval == NULL)
>                 {
> 
> is that we only need to emit the EEOP_MAKE_READONLY once when there are
> multiple CHECK constraints.  But because domainval has the wrong lifespan,
> that test is constant-true, and we'll do it over each time to little
> purpose.

Oh, I clearly re-skimmed the code too quickly. Sorry for that!


> (AFAICS anyway)
> 
> I'm unexcited by the proposed move of the save_innermost_domainval/null
> variables, though.  It adds no correctness and it forces an additional
> level of indentation of a good deal of code, as the patch fails to show.

Yea.

Greetings,

Andres Freund



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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: windows build slow due to windows.h includes
Следующее
От: Ranier Vilela
Дата:
Сообщение: Re: Eval expression R/O once time (src/backend/executor/execExpr.c)