Re: [GENERAL] pg_dump incredibly slow dumping a single schema from a large db - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [GENERAL] pg_dump incredibly slow dumping a single schema from a large db
Date
Msg-id 25863.1333223801@sss.pgh.pa.us
Whole thread Raw
In response to Re: [GENERAL] pg_dump incredibly slow dumping a single schema from a large db  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [GENERAL] pg_dump incredibly slow dumping a single schema from a large db  (Mike Roest <mike.roest@replicon.com>)
List pgsql-hackers
I wrote:
> So this is dumb; we should manage the "is the object already processed"
> component of that with an O(1) check, like a bool array or some such,
> rather than an O(N) search loop.

> As for the getTables slowdown, the only part of that I can see that
> looks to be both significant and entirely contained in getTables()
> itself is the nested loop near the end that's trying to copy
> the dumpable flags for owned sequences from their owning tables.
> Do you have a whole lot of owned sequences?  Maybe we could postpone
> that work until we have the fast table lookup array constructed,
> which should reduce this from O(M*N) to O(M*logN).

I've committed fixes for both these issues.  If you are in a position to
test with 9.1 branch tip from git, it'd be nice to have confirmation
that these patches actually cure your problem.  For both of them, the
issue seems to only show up in a subset of cases, which may explain why
we'd not identified the problem before.

            regards, tom lane

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [COMMITTERS] pgsql: Add PGDLLIMPORT to ScanKeywords and NumScanKeywords.
Next
From: Mike Roest
Date:
Subject: Re: [GENERAL] pg_dump incredibly slow dumping a single schema from a large db