Re: strange OOM errors with EXECUTE in PL/pgSQL
От
Dimitri Fontaine
Тема
Re: strange OOM errors with EXECUTE in PL/pgSQL
Дата
Msg-id
m2a9t8iefy.fsf@2ndQuadrant.fr
Ответ на
Список
Дерево обсуждения
strange OOM errors with EXECUTE in PL/pgSQL Tomas Vondra <tv@fuzzy.cz>
Re: strange OOM errors with EXECUTE in PL/pgSQL Tom Lane <tgl@sss.pgh.pa.us>
Re: strange OOM errors with EXECUTE in PL/pgSQL Tomas Vondra <tv@fuzzy.cz>
Re: strange OOM errors with EXECUTE in PL/pgSQL Dimitri Fontaine <dimitri@2ndQuadrant.fr>
Re: strange OOM errors with EXECUTE in PL/pgSQL Jan Wieck <JanWieck@Yahoo.com>
Re: strange OOM errors with EXECUTE in PL/pgSQL Tom Lane <tgl@sss.pgh.pa.us>
Tom Lane writes: > The reason this fails is that you've got a half-megabyte source string, > and each of the 11000 plans that are due to be created from it saves > its own copy of the source string. Hence, 5500 megabytes needed just > for source strings. > > We could possibly fix this by inventing some sort of reference-sharing > arrangement (which'd be complicated and fragile) or by not storing the > source strings with the plans (which'd deal a serious blow to our > ability to provide helpful error messages). Neither answer seems > appealing. I don't readily see how complicated and fragile it would be, it looks like a hash table of symbols pointing to source strings and a reference counting, and each plan would need to reference that symbol. Now maybe that's what you call complicated and fragile, and even if not, I'm not really sure it would pull its weight. The use case of sending over and over again *in a given session* the exact same query string without using PREPARE/EXECUTE looks like quite tiny. -- Dimitri Fontaine http://2ndQuadrant.fr PostgreSQL : Expertise, Formation et Support
В списке pgsql-hackers по дате отправления
От: Dimitri Fontaine
Дата: