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

From: Tatsuro Yamada <tatsuro(dot)yamada(dot)tf(at)nttcom(dot)co(dot)jp>
To: torikoshia <torikoshia(at)oss(dot)nttdata(dot)com>, Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Cc: masao(dot)fujii(at)oss(dot)nttdata(dot)com, pavel(dot)stehule(at)gmail(dot)com, legrand_legrand(at)hotmail(dot)com, Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
Subject: Re: Is it useful to record whether plans are generic or custom?
Date: 2021-01-27 23:11:08
Message-ID: 4008d911-bde2-5dfb-625f-5a4d43e6c765@nttcom.co.jp_1
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Toricoshi-san,

On 2021/01/12 20:36, torikoshia wrote:
> I suppose it would be normal practice to store past results of
> pg_stat_statements for future comparisons.
> If this is the case, I think that if we only add the number of
> generic plan execution, it will give us a hint to notice the cause
> of performance degradation due to changes in the plan between
> generic and custom.
>
> For example, if there is a clear difference in the number of times
> the generic plan is executed between before and after performance
> degradation as below, it would be natural to check if there is a
> problem with the generic plan.
...
> Attached a patch that just adds a generic call counter to
> pg_stat_statements.

I think that I'd like to use the view when we faced a performance
problem and find the reason. If we did the fixed-point observation
(should I say time-series analysis?) of generic_calls, it allows us to
realize the counter changes, and we can know whether the suspect is
generic_plan or not. So the patch helps DBA, I believe.

Regards,
Tatsuro Yamada

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bossart, Nathan 2021-01-27 23:16:26 Re: Add MAIN_RELATION_CLEANUP and SECONDARY_RELATION_CLEANUP options to VACUUM
Previous Message Tatsuro Yamada 2021-01-27 23:02:02 Re: Is it useful to record whether plans are generic or custom?