On Wed, Mar 10, 2021 at 1:49 PM yuzuko <yuzukohos...@gmail.com> wrote: > > Hello, > > I thought about this suggestion again. > > Amit's patch suggested in the thread [1] can eliminate SPI plans from > INSERT/UPDATE triggers, so our memory pressure issue would be solved. > But as far as I can see that thread, Amit's patch doesn't cover DELETE case. > It is not a common case, but there is a risk of pressing memory > capacity extremely. > Considering that, this suggestion might still have good value as Corey > said before. > > I improved a patch according to Peter's following comment : > > but I think the > > solution of dropping all cached plans as part of DISCARD ALL seems a bit > > too extreme of a solution. In the context of connection pooling, > > getting a new session with pre-cached plans seems like a good thing, and > > this change could potentially have a performance impact without a > > practical way to opt out. > > In a new patch, I separated discarding SPI Plan caches for RI from DISCARD ALL > and added a new option "RIPLANS" to DISCARD command to do that. Also a new > function, ResetRIPlanCache() which clears SPI plan caches is called by > DISCARD ALL > or DISCARD RIPLANS. The amount of modification is small and this option can > be > removed instantly when it is no longer needed, so I think we can use > this patch as > a provisional solution. > > Any thoughts?
The patch does not apply on Head anymore, could you rebase and post a patch. I'm changing the status to "Waiting for Author". Regards, Vignesh