Let plan_cache_mode to be a little less strict

From: Andrei Lepikhov <lepihov(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Let plan_cache_mode to be a little less strict
Date: 2025-07-15 10:53:18
Message-ID: 458ace73-4827-43e1-8a30-734a93d4720f@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

I believe the behaviour of the choose_custom_plan function should be
adjusted slightly.

The CachedPlanSource can operate in either auto mode or force a specific
plan type. Currently, the force_generic_plan option declares all plans
as generic, except one-shot plans, of course. However, the
CachedPlanSource entry also has a cursor_options field that indicates
the caller's anticipation of a specific plan type for the statement.
This means that the configuration parameter (GUC) currently overrides
any explicit request for a plan type. The documentation does not clearly
explain the rationale behind this, at least to me.
I propose that the declaration of cursor_options should take precedence
over the GUC. This change would alter the interpretation of the GUC from
a 'forced' plan type to a 'default' plan type. By making this
adjustment, users and extensions can be more assured that they will
receive the requested plan type.

If there are no objections, I will add this patch to the next commitfest.

--
regards, Andrei Lepikhov

Attachment Content-Type Size
v0-0001-Make-the-plan-cache-forced-modes-more-flexible.patch text/plain 1.4 KB

Browse pgsql-hackers by date

  From Date Subject
Next Message Rustam Khamidullin 2025-07-15 11:02:31 [PATCH] Speed up of vac_update_datfrozenxid.
Previous Message cca5507 2025-07-15 10:46:42 Re: Logical replication launcher did not automatically restart when got SIGKILL