Re: Is it useful to record whether plans are generic or custom? - Mailing list pgsql-hackers

From torikoshia
Subject Re: Is it useful to record whether plans are generic or custom?
Date
Msg-id cd1069769db5b296115c14d6ac922731@oss.nttdata.com
Whole thread Raw
In response to Re: Is it useful to record whether plans are generic or custom?  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
Responses Re: Is it useful to record whether plans are generic or custom?
List pgsql-hackers
On 2020-06-10 18:00, Kyotaro Horiguchi wrote:

> 
> +    TupleDescInitEntry(tupdesc, (AttrNumber) 8, "last_plan",
> 
> This could be a problem if we showed the last plan in this view.  I
> think "last_plan_type" would be better.
> 
> +            if (prep_stmt->plansource->last_plan_type == 
> PLAN_CACHE_TYPE_CUSTOM)
> +                values[7] = CStringGetTextDatum("custom");
> +            else if (prep_stmt->plansource->last_plan_type == 
> PLAN_CACHE_TYPE_GENERIC)
> +                values[7] = CStringGetTextDatum("generic");
> +            else
> +                nulls[7] = true;
> 
> Using swith-case prevents future additional type (if any) from being
> unhandled.  I think we are recommending that as a convension.

Thanks for your reviewing!

I've attached a patch that reflects your comments.


Regards,

--
Atsushi Torikoshi
Attachment

pgsql-hackers by date:

Previous
From: Dong Wook Lee
Date:
Subject: Add tap test for --extra-float-digits option
Next
From: Julien Rouhaud
Date:
Subject: Re: Collation versioning