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 65fbc50741c558bae5470e15ef33c4c7@oss.nttdata.com
Whole thread Raw
In response to Re: Is it useful to record whether plans are generic or custom?  (Fujii Masao <masao.fujii@oss.nttdata.com>)
Responses Re: Is it useful to record whether plans are generic or custom?
Re: Is it useful to record whether plans are generic or custom?
List 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,



pgsql-hackers by date:

Previous
From: Dilip Kumar
Date:
Subject: Re: Remove incorrect assertion in reorderbuffer.c.
Next
From: Fujii Masao
Date:
Subject: Re: [PATCH] postgres_fdw connection caching - cause remote sessions linger till the local session exit