X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id DBEAB562EF for ; Thu, 3 Mar 2005 18:31:06 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 55345-09 for ; Thu, 3 Mar 2005 18:30:58 +0000 (GMT) Received: from mm02snlnto.son.sandia.gov (mm02snlnto.sandia.gov [132.175.109.21]) by svr1.postgresql.org (Postfix) with ESMTP id 9FED6560C6 for ; Thu, 3 Mar 2005 18:30:56 +0000 (GMT) Received: from 132.175.109.4 by mm02snlnto.son.sandia.gov with ESMTP ( Tumbleweed MMS SMTP Relay 01 (MMS v5.6.3)); Thu, 03 Mar 2005 11:30:47 -0700 X-Server-Uuid: 914ACFB1-8EBC-470E-882B-54A00EED9786 Received: from ES22SNLNT.srn.sandia.gov (ec03snlnt.sandia.gov [134.253.164.158] (may be forged)) by mailgate2.sandia.gov ( 8.12.11/8.12.11) with ESMTP id j23IUiTn013540 for ; Thu, 3 Mar 2005 11:30:45 -0700 (MST) Received: from 134.252.13.164 ([134.252.13.164]) by ES22SNLNT.srn.sandia.gov ([134.253.164.160]) with Microsoft Exchange Server HTTP-DAV ; Thu, 3 Mar 2005 18:30:45 +0000 Received: from boomerang by ES22SNLNT.srn.sandia.gov; 03 Mar 2005 10:29: 17 -0800 Subject: Re: Building a database from a flat file From: "Casey T. Deccio" To: pgsql-sql@postgresql.org In-Reply-To: <8014dca0db521733863bb7967ce4be95@mail.nih.gov> References: <1109808921.12430.75.camel@boomerang.ran.sandia.gov> <8014dca0db521733863bb7967ce4be95@mail.nih.gov> Organization: Sandia National Laboratories Date: Thu, 03 Mar 2005 10:29:17 -0800 Message-ID: <1109874557.12428.90.camel@boomerang.ran.sandia.gov> MIME-Version: 1.0 X-Mailer: Evolution 2.0.3 X-PMX-Version: 4.7.0.111621, Antispam-Engine: 2.0.1.0, Antispam-Data: 2005.3.3.9 X-WSS-ID: 6E39885D1JG1195370-01-01 Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=1.425 tagged_above=0 required=5 tests=AWL, RCVD_NUMERIC_HELO X-Spam-Level: * X-Archive-Number: 200503/48 X-Sequence-Number: 20527 On Thu, 2005-03-03 at 06:23 -0700, Sean Davis wrote: > Why not rebuild the entire thing in a separate "build" schema then do > only the stuff like copying tables inside the transaction block: > Building everything in the separate "build" schema works great, but it is the DELETE (TRUNCATE won't work when foreign keys point to the table) that took the most time in the transaction. However, renaming the schemas, as suggested in other posts, worked great. Casey