From: | Ranier Vilela <ranier(dot)vf(at)gmail(dot)com> |
---|---|
To: | Andres Freund <andres(at)anarazel(dot)de> |
Cc: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Eval expression R/O once time (src/backend/executor/execExpr.c) |
Date: | 2021-09-21 23:13:13 |
Message-ID: | CAEudQAr9_cGPzpbCwPWVmYhtZR3ZSfs5Nc3gVFreD7SQjS+9Fw@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Em ter., 21 de set. de 2021 às 20:00, Andres Freund <andres(at)anarazel(dot)de>
escreveu:
> Hi,
>
> On 2021-09-21 18:21:24 -0400, Tom Lane wrote:
> > Andres Freund <andres(at)anarazel(dot)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!
>
No problem, thanks for taking a look.
regards,
Ranier Vilela
From | Date | Subject | |
---|---|---|---|
Next Message | Ranier Vilela | 2021-09-21 23:26:36 | Re: windows build slow due to windows.h includes |
Previous Message | Ranier Vilela | 2021-09-21 23:12:33 | Re: Eval expression R/O once time (src/backend/executor/execExpr.c) |