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 7AE4FD1B502 for ; Thu, 13 Nov 2003 22:03:28 +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 40423-03 for ; Thu, 13 Nov 2003 18:02:58 -0400 (AST) Received: from web21401.mail.yahoo.com (web21401.mail.yahoo.com [216.136.232.71]) by svr1.postgresql.org (Postfix) with SMTP id B2506D1B535 for ; Thu, 13 Nov 2003 18:02:39 -0400 (AST) Message-ID: <20031113220241.94962.qmail@web21401.mail.yahoo.com> Received: from [64.81.205.234] by web21401.mail.yahoo.com via HTTP; Thu, 13 Nov 2003 14:02:41 PST Date: Thu, 13 Nov 2003 14:02:41 -0800 (PST) From: ow Subject: pg_restore and FK constraints with large dbs To: pgsql-admin@postgresql.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200311/253 X-Sequence-Number: 11240 pgSql 7.4.rc2 Hi, Am somewhat lost about how one should use pg_restore with large dbs. For simplicity, let's assume that db has only one (1) table with huge amout of rows. Tried several approaches: 1) dump the data only, create the table with all indexes and constraints (from script that has nothing to do with pg_restore), import the data. The import part was running for hours (14+) with no end in sight. Had to kill it. 2) dump the data only, create the table with no indexes or constraints, import the data, recreate indexes and constraints. This approach produced better results. Data were imported in about two (2) hours, indexes also were created fairly quickly. Howerver, creattion of FK constraints is killing performance again. It appears in the past there was some discussion regarding the ability to create a FK constraint without actually checking the records. It makes a lot of sense when importing data from pg_restore since data comes from db where the constraint was in place, hence it's clean. Any ideas? Thanks __________________________________ Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard http://antispam.yahoo.com/whatsnewfree