Tom Lane t...@sss.pgh.pa.us writes:
Tao Ma feng_e...@163.com writes:
I knew that the delete_function() will reclaim the memory context
allocated for the function. But I did not find any code for removing
the plan(SPI plan memory context), saved by calling _SPI_save_plan.
Hmmm ... good point,
Tao Ma feng_e...@163.com writes:
I knew that the delete_function() will reclaim the memory context
allocated for the function. But I did not find any code for removing
the plan(SPI plan memory context), saved by calling _SPI_save_plan.
Hmmm ... good point, those probably won't get cleaned up.
Hi,
It seems postgres cache the plan under CacheMemoryContext during the
plpgsql executing.
If there is a function with lots of variables and every one of them got a
default value,
postgres will allocate lots of memory for caching the default value plan(we
have to run
the function at least
Tao Ma feng_e...@163.com writes:
Once we DROP the function, the memory consumed
by the plan will be leak.
I'm pretty unconcerned about DROP FUNCTION. The case that seems worth
worrying about is CREATE OR REPLACE FUNCTION, and in that case we'll
reclaim the storage on the next call of the
I knew that the delete_function() will reclaim the memory context
allocated for the function. But I did not find any code for removing
the plan(SPI plan memory context), saved by calling _SPI_save_plan.
Is the plan memory context freed when someone issued CREATE OR
REPLACE FUNCTION?
Thanks.
Tom