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

From: torikoshia <torikoshia(at)oss(dot)nttdata(dot)com>
To: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>, Tatsuro Yamada <tatsuro(dot)yamada(dot)tf(at)nttcom(dot)co(dot)jp>
Cc: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, legrand legrand <legrand_legrand(at)hotmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Is it useful to record whether plans are generic or custom?
Date: 2020-12-04 06:03:25
Message-ID: 65fbc50741c558bae5470e15ef33c4c7@oss.nttdata.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2020-12-04 14:29, Fujii Masao wrote:
> On 2020/11/30 15:24, Tatsuro Yamada wrote:
>> Hi Torikoshi-san,
>>
>>
>>> In this patch, exposing new columns is mandatory, but I think
>>> it's better to make it optional by adding a GUC something
>>> like 'pgss.track_general_custom_plans.
>>>
>>> I also feel it makes the number of columns too many.
>>> Just adding the total time may be sufficient.
>>
>>
>> I think this feature is useful for DBA. So I hope that it gets
>> committed to PG14. IMHO, many columns are Okay because DBA can
>> select specific columns by their query.
>> Therefore, it would be better to go with the current design.
>
> But that design may waste lots of memory. No? For example, when
> plan_cache_mode=force_custom_plan, the memory used for the columns
> for generic plans is not used.
>

Yeah.

ISTM now that creating pg_stat_statements_xxx views
both for generic andcustom plans is better than my PoC patch.

And I'm also struggling with the following.

| However, I also began to wonder how effective it would be to just
| distinguish between generic and custom plans. Custom plans can
| include all sorts of plans. and thinking cache validation, generic
| plans can also include various plans.

| Considering this, I'm starting to feel that it would be better to
| not just keeping whether generic or cutom but the plan itself as
| discussed in the below thread.

Yamada-san,

Do you think it's effective just distinguish between generic
and custom plans?

Regards,

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2020-12-04 06:19:23 Re: [PATCH] postgres_fdw connection caching - cause remote sessions linger till the local session exit
Previous Message Dilip Kumar 2020-12-04 05:48:59 Re: Remove incorrect assertion in reorderbuffer.c.