Skip site navigation (1) Skip section navigation (2)

Re: question about the _SPI_save_plan() and plan cache

From: "Tao Ma" <feng_eden(at)163(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: question about the _SPI_save_plan() and plan cache
Date: 2009-07-28 15:58:08
Message-ID: h4n76e$298q$1@news.hub.org (view raw or flat)
Thread:
Lists: pgsql-hackers
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 Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrotes:25310(dot)1248791701(at)sss(dot)pgh(dot)pa(dot)us(dot)(dot)(dot)
> "Tao Ma" <feng_eden(at)163(dot)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 function.
>
> regards, tom lane
>
> -- 
> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
> 



In response to

Responses

pgsql-hackers by date

Next:From: Greg SmithDate: 2009-07-28 16:10:57
Subject: Re: multi-threaded pgbench
Previous:From: Teodor SigaevDate: 2009-07-28 15:46:31
Subject: Re: Index-only-scans, indexam API changes

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group