Re: pg_dump out of memory for large table with LOB - Mailing list pgsql-general

From Adrien Nayrat
Subject Re: pg_dump out of memory for large table with LOB
Date
Msg-id 73d2f4fb-3da4-1c09-8bff-88a35f16bcd2@anayrat.info
Whole thread Raw
In response to pg_dump out of memory for large table with LOB  (Jean-Marc Lessard <Jean-Marc.Lessard@ultra-ft.com>)
Responses RE: pg_dump out of memory for large table with LOB
List pgsql-general
Hello,

On 11/10/18 12:49 AM, Jean-Marc Lessard wrote:
> The dumped table is 0.5TB, 17 million rows and LOB uses about 99% of the space.
>

If I understand, you have 17 million Large Object?

I do not recall exactly and maybe I am wrong. But it seems pg_dump has to
allocate memory for each object to dump :
addBoundaryDependencies:

    for (i = 0; i < numObjs; i++)
[...]

case DO_BLOB_DATA:
    /* Data objects: must come between the boundaries */
    addObjectDependency(dobj, preDataBound->dumpId);
    addObjectDependency(postDataBound, dobj->dumpId);
    break;

addObjectDependency:

[...]
                pg_malloc(dobj->allocDeps * sizeof(DumpId));


With 17 million LO, it could eat lot of memory ;)


Attachment

pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: pg_dump out of memory for large table with LOB
Next
From: Rob Nikander
Date:
Subject: query patterns for multipass aggregating