Re: Is it useful to record whether plans are generic or custom?

Поиск
Список
Период
Сортировка
От torikoshia
Тема Re: Is it useful to record whether plans are generic or custom?
Дата
Msg-id cd1069769db5b296115c14d6ac922731@oss.nttdata.com
обсуждение исходный текст
Ответ на Re: Is it useful to record whether plans are generic or custom?  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
Ответы Re: Is it useful to record whether plans are generic or custom?  (Fujii Masao <masao.fujii@oss.nttdata.com>)
Список 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
Вложения

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

Предыдущее
От: Dong Wook Lee
Дата:
Сообщение: Add tap test for --extra-float-digits option
Следующее
От: Julien Rouhaud
Дата:
Сообщение: Re: Collation versioning