pg_restore and FK constraints with large dbs

From: ow <oneway_111(at)yahoo(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Subject: pg_restore and FK constraints with large dbs
Date: 2003-11-13 22:02:41
Message-ID: 20031113220241.94962.qmail@web21401.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

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

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Peter Eisentraut 2003-11-13 22:06:17 Re: Moving Database Directory
Previous Message Greg Spiegelberg 2003-11-13 21:48:07 Moving Database Directory