From: Tom Lane <tgl@sss.pgh.pa.us>
To: boleslaw.ziobrowski@yahoo.pl
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #14384: pg_dump uses excessive amounts of memory for LOBs
Date: Thu, 20 Oct 2016 09:23:27 -0400
Message-ID: <29613.1476969807@sss.pgh.pa.us> (raw)
In-Reply-To: <20161020075649.1397.16074@wrigleys.postgresql.org>
References: <20161020075649.1397.16074@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
boleslaw.ziobrowski@yahoo.pl writes:
> pg_dump seems to allocate memory proportional to the number of rows in
> pg_largeobject (not necessarily correlated with size of these objects) ,
Yes, it does. It also allocates memory proportional to the number of,
eg, tables, or any other DB object for that matter.
This is a consequence of the fact that blobs grew owners and privileges
in 9.0. pg_dump uses its usual per-object infrastructure to keep track
of that. The argument was that this'd be okay because if your large
objects are, well, large, then there couldn't be so many of them that
the space consumption would be fatal. I had doubts about that at the
time, but I think we're more or less locked into it now. It would
take a lot of restructuring to change it, and we'd lose functionality
too, because we couldn't have a separate TOC entry per blob. That
means no ability to select out individual blobs during pg_restore.
TL;DR: blobs are not exactly lightweight objects. If you want something
with less overhead, maybe you should just store the data in a plain
bytea column.
regards, tom lane
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, boleslaw.ziobrowski@yahoo.pl
Subject: Re: BUG #14384: pg_dump uses excessive amounts of memory for LOBs
In-Reply-To: <29613.1476969807@sss.pgh.pa.us>
References: <20161020075649.1397.16074@wrigleys.postgresql.org> <29613.1476969807@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox