Re: should num_custom_plans be reset after plan invalidation? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: should num_custom_plans be reset after plan invalidation?
Date
Msg-id 304268.1741186366@sss.pgh.pa.us
Whole thread Raw
In response to should num_custom_plans be reset after plan invalidation?  (Sami Imseih <samimseih@gmail.com>)
Responses Re: should num_custom_plans be reset after plan invalidation?
List pgsql-hackers
Sami Imseih <samimseih@gmail.com> writes:
> While examining plan caches, I noticed that when a generic plan is invalidated,
> the next execution of the prepared statement still results in a
> generic plan. This
> is of course with the default plan_cache_mode.

> This behavior might go unnoticed since plan cache invalidations are
> relatively uncommon,
> but I’m unsure if this is the intended design.

Yes, it is.  There's little reason to expect that the invalidation
would change our decision, and re-planning five times to confirm that
is a high price to pay.

Sure, the invalidation *might* have been because of a new index
that happens to fit the query, but the odds of that seem small to me.
It's much more likely because of auto-vacuum tweaking the stats, or
just a random sinval queue overrun.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Israel Barth Rubio
Date:
Subject: Re: Add -k/--link option to pg_combinebackup
Next
From: Nazir Bilal Yavuz
Date:
Subject: Upgrade FreeBSD CI images to 14.2