Re: Optimizing nested ConvertRowtypeExpr execution

From: Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)com>
To: Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>
Cc: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Optimizing nested ConvertRowtypeExpr execution
Date: 2018-04-09 12:16:13
Message-ID: CAFjFpRdqqYguq7j1sbd+U693KMF5UkxHZuEcAfhtZ6Eq-QyqXg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Apr 9, 2018 at 5:34 PM, Kyotaro HORIGUCHI
<horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp> wrote:
>
> The new code doesn't seem to work as written.
>
>> arg = eval_const_expressions_mutator((Node *) cre->arg,
>> context);
>>
>> /*
>> * In case of a nested ConvertRowtypeExpr, we can convert the
>> * leaf row directly to the topmost row format without any
>> * intermediate conversions.
>> */
>> while (arg != NULL && IsA(arg, ConvertRowtypeExpr))
>> arg = (Node *) castNode(ConvertRowtypeExpr, arg)->arg;
>
> This runs depth-first so the while loop seems to run at most
> once. I suppose that the "arg =" and the while loop are
> transposed as intention.

Yes. I have modelled it after RelableType case few lines above in the
same function.

--
Best Wishes,
Ashutosh Bapat
EnterpriseDB Corporation
The Postgres Database Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Craig Ringer 2018-04-09 12:16:38 Re: PostgreSQL's handling of fsync() errors is unsafe and risks data loss at least on XFS
Previous Message Kyotaro HORIGUCHI 2018-04-09 12:11:04 Re: Fixing a trivial typo in comment in rewriteManip.c