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

Re: DISCARD ALL ; stored procedures

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: DISCARD ALL ; stored procedures
Date: 2011-01-06 22:09:12
Message-ID: AANLkTimkx-973KnJ8oj4uNi286t3u8pSdK3Y0sRasw=n@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-hackers
On Thu, Jan 6, 2011 at 4:30 PM, Stephen Frost <sfrost(at)snowman(dot)net> wrote:
> * Merlin Moncure (mmoncure(at)gmail(dot)com) wrote:
>> this is a problem. under what circumstances would you want to discard
>> them and why?  the main problem I see with cached plpgsql plans is
>> interactions with search_path -- but DISCARD might not be the best way
>> to attack that problem.  There might be other reasons though.
>
> interaction w/ search_path (or, rather, lack of respect for it..) is
> exactly the issue here for me.

this has been discussed a couple of times -- a plausible alternative
might be to adjust the plan caching mechanism to organize the plan
cache around search_path.  that way you get a separate plan per
search_path instance.

discard has zero backwards compatibility issues but has one big
problem -- if you are using combination of connection pooling, lots of
plpgsql and search_path manipulation, you take a big performance hit.
in other words, even if you can discard everything., do you really
want to?

merlin

In response to

Responses

pgsql-hackers by date

Next:From: Stephen FrostDate: 2011-01-06 22:22:10
Subject: Re: DISCARD ALL ; stored procedures
Previous:From: Stephen FrostDate: 2011-01-06 21:30:50
Subject: Re: DISCARD ALL ; stored procedures

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