From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jeff Janes <jeff.janes@gmail.com>
Cc: Hugo <hugo.tech@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: pg_dump and thousands of schemas
Date: Mon, 28 May 2012 18:26:36 -0400
Message-ID: <15138.1338243996@sss.pgh.pa.us> (raw)
In-Reply-To: <CAMkU=1zxd_vn5DPw9W6cKe==f=pxScbQE=cd7Gq69eO0YjGsTg@mail.gmail.com>
References: <1337843209018-5709766.post@n5.nabble.com>
<CAFwQ8rdZ3LjiwdDuzNR3vN=OryQ6fzDb08hzeKzNbOzrQXNPbA@mail.gmail.com>
<CAMkU=1zgUUqT6ZPAFAMR6cFx01Bbk+y05Fmwk63PBHOMrBPPoQ@mail.gmail.com>
<20120525035455.GC25444@momjian.us>
<1337921645663-5709975.post@n5.nabble.com>
<20887.1337956883@sss.pgh.pa.us>
<1338091933763-5710183.post@n5.nabble.com>
<CAMkU=1zxd_vn5DPw9W6cKe==f=pxScbQE=cd7Gq69eO0YjGsTg@mail.gmail.com>
Jeff Janes <jeff.janes@gmail.com> writes:
> There is a quadratic behavior in pg_dump's "mark_create_done". This
> should probably be fixed, but in the mean time it can be circumvented
> by using -Fc rather than -Fp for the dump format. Doing that removed
> 17 minutes from the run time.
Hmm, that would just amount to postponing the work from pg_dump to
pg_restore --- although I suppose it could be a win if the dump is for
backup purposes and you probably won't ever have to restore it.
inhibit_data_for_failed_table() has the same issue, though perhaps it's
less likely to be exercised; and there is a previously noted O(N^2)
behavior for the loop around repoint_table_dependencies.
We could fix these things by setting up index arrays that map dump ID
to TocEntry pointer and dump ID of a table to dump ID of its TABLE DATA
TocEntry. The first of these already exists (tocsByDumpId) but is
currently built only if doing parallel restore. We'd have to build it
all the time to use it for fixing mark_create_done. Still, the extra
space is small compared to the size of the TocEntry data structures,
so I don't see that that's a serious objection.
I have nothing else to do right now so am a bit tempted to go fix this.
> I'm working on a patch to reduce the LockReassignCurrentOwner problem
> in the server when using pg_dump with lots of objects.
Cool.
regards, tom lane
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 using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: tgl@sss.pgh.pa.us, jeff.janes@gmail.com, hugo.tech@gmail.com
Subject: Re: pg_dump and thousands of schemas
In-Reply-To: <15138.1338243996@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