Re: DO with a large amount of statements get stuck with high memory consumption

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Merlin Moncure <mmoncure(at)gmail(dot)com>
Cc: Jan Wieck <jan(at)wi3ck(dot)info>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: DO with a large amount of statements get stuck with high memory consumption
Date: 2016-07-18 13:43:07
Message-ID: 28143.1468849387@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Merlin Moncure <mmoncure(at)gmail(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jan Wieck 2016-07-18 13:59:15 Re: DO with a large amount of statements get stuck with high memory consumption
Previous Message AMatveev 2016-07-18 13:41:55 Re: One process per session lack of sharing