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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: DO with a large amount of statements get stuck with high memory consumption
Дата
Msg-id 22342.1468852097@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: DO with a large amount of statements get stuck with high memory consumption  (Merlin Moncure <mmoncure@gmail.com>)
Список pgsql-hackers
Merlin Moncure <mmoncure@gmail.com> writes:
> Hm, maybe, instead of trying to figure out if in a loop, set a
> 'called' flag  with each statement and only cache when touched the
> second time.  (If that's easier, dunno).

Well, then you just guarantee to lose once.  I think Jan's sketch of
marking potentially-cacheable expressions at compile time sounds
promising.  I'm envisioning a counter that starts at 1 normally or 0 in a
DO block, increment at beginning of parsing a loop construct, decrement at
end; then mark expressions/statements as cacheable if counter>0.

Of course the next question is what exactly to do differently for a
noncacheable expression.  My recollection is that that's all tied
pretty tightly to the plancache these days, so it might take a little
work.
        regards, tom lane



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: DO with a large amount of statements get stuck with high memory consumption
Следующее
От: Tom Lane
Дата:
Сообщение: Re: rethinking dense_alloc (HashJoin) as a memory context