X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 3B7D2D1B50A for ; Sun, 16 Nov 2003 18:21:18 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 95459-02 for ; Sun, 16 Nov 2003 14:20:47 -0400 (AST) Received: from megazone.bigpanda.com (megazone.bigpanda.com [64.147.171.210]) by svr1.postgresql.org (Postfix) with ESMTP id 80F11D1B550 for ; Sun, 16 Nov 2003 14:20:46 -0400 (AST) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 3E329353BA; Sun, 16 Nov 2003 10:20:41 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id 3C898353A0; Sun, 16 Nov 2003 10:20:41 -0800 (PST) Date: Sun, 16 Nov 2003 10:20:41 -0800 (PST) From: Stephan Szabo To: ow Cc: Peter Eisentraut , pgsql-admin@postgresql.org Subject: Re: pg_restore and FK constraints with large dbs In-Reply-To: <20031116164544.72117.qmail@web21405.mail.yahoo.com> Message-ID: <20031116101702.Q64286@megazone.bigpanda.com> References: <20031116164544.72117.qmail@web21405.mail.yahoo.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200311/305 X-Sequence-Number: 11292 On Sun, 16 Nov 2003, ow wrote: > --- Peter EiEisentrautpeter_e@gmgmxet> wrote: > > > > Read again. No one was talking of pg_restore. > > Perhaps I should clarify. > > First, I ran pg_dump to extract schema and data *together*. Then I ran > pg_restore to restore the db. It took about 1 hour to create tables and copy > the data, then about 40 min to create indexes, then pg_restore spent 4.5 hours > checking one (1) FKFKonstraint (80M table with FKFKsgainst 20K table with PKPKs > > 4.5 hours to check one FKFKonstraint - this is want I meant by bad performance. > I'm looking for a way to suspend FKFKhecks since data is coming from pg_dump > and, hence, it's clean. Only assuming that no changes were made between dump and restore. This could be changes to schema or data done manually, but it could also be a locale or possibly encoding change if you have any textual foreign keys.