Re: DO with a large amount of statements get stuck with high memory consumption - Mailing list pgsql-hackers

From Tom Lane
Subject Re: DO with a large amount of statements get stuck with high memory consumption
Date
Msg-id 28143.1468849387@sss.pgh.pa.us
Whole thread Raw
In response to Re: DO with a large amount of statements get stuck with high memory consumption  (Merlin Moncure <mmoncure@gmail.com>)
Responses Re: DO with a large amount of statements get stuck with high memory consumption  (Jan Wieck <jan@wi3ck.info>)
List pgsql-hackers
Merlin Moncure <mmoncure@gmail.com> writes:
> BTW, while the fix does address the cleanup performance issue, it's
> still the case that anonymous code blocks burn up lots of resident
> memory (my 315k example I tested with ate around 8gb IIRC) when run
> like this.  My question is, if the pl/pgsql code block is anonymous
> and not in some kind of a loop, why bother caching the plan at all?

Nobody got around to it.  Also, as you note, it's not as simple as
"don't cache if in a DO block".  You'd need to track whether you were
inside any sort of looping construct.  Depending on how difficult
that turned out to be, it might add overhead to regular functions
that we don't want.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Merlin Moncure
Date:
Subject: Re: DO with a large amount of statements get stuck with high memory consumption
Next
From: AMatveev@bitec.ru
Date:
Subject: Re: One process per session lack of sharing