Re: Let plan_cache_mode to be a little less strict - Mailing list pgsql-hackers

From Andrei Lepikhov
Subject Re: Let plan_cache_mode to be a little less strict
Date
Msg-id 9549f477-92a3-4077-953b-1b42c770c218@gmail.com
Whole thread Raw
In response to Re: Let plan_cache_mode to be a little less strict  (Michael Paquier <michael@paquier.xyz>)
List pgsql-hackers
On 4/8/2025 06:23, Michael Paquier wrote:
> On Fri, Aug 01, 2025 at 03:07:08PM +0200, Andrei Lepikhov wrote:
>> I considered the worker_spi.c module, which demonstrates various SPI usage
>> patterns. It might be more beneficial to use this instead of creating
>> another test module, isn't it?
> 
> worker_spi is a playground for bgworker tests, so I'm not eager to
> make it more complex for the case of cached planned.  SQL tests have
> more benefits here, IMO, and they should be more efficient and more
> predictible.  worker_spi can only work with TAP.

I began to implement the idea, described above and got stuck on the 
issue that we can't explain an SPI plan. It is possible to invent an 
'auto_explain' approach (as a TAP test, of course), but it looks wrong.
As an alternative, it is feasible to add to the SPI interface an 
SPI_explain_plan routine using the analogy of ExplainExecuteQuery. I 
recall hearing some requests for this kind of feature before. Is this a 
commitable way?

See the patch attached. Do I understand correctly the 'SPI wrapper' 
approach?

-- 
regards, Andrei Lepikhov
Attachment

pgsql-hackers by date:

Previous
From: Ashutosh Bapat
Date:
Subject: Re: [Proposal] Expose internal MultiXact member count function for efficient monitoring
Next
From: Heikki Linnakangas
Date:
Subject: Re: BackendKeyData is mandatory?