question about the _SPI_save_plan() and plan cache - Mailing list pgsql-hackers

From Tao Ma
Subject question about the _SPI_save_plan() and plan cache
Date
Msg-id h4mib4$9i0$1@news.hub.org
Whole thread Raw
Responses Re: question about the _SPI_save_plan() and plan cache
List pgsql-hackers
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 once). Once we DROP the function, the memory consumed 
by the plan
will be leak. The same thing for the compiled function 
structure(PLpgSQL_function).
 Is this an oldest known question?


Thanks,
Tao Ma





pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Re: [COMMITTERS] pgsql: Reserve the shared memory region during backend startup on
Next
From: "Kevin Grittner"
Date:
Subject: Re: Review: Revise parallel pg_restore's scheduling heuristic