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 8426A5639A for ; Thu, 3 Mar 2005 15:28:44 +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 02023-07 for ; Thu, 3 Mar 2005 15:28:39 +0000 (GMT) Received: from mail.logix-tt.com (wallaby.dingens.org [212.75.36.180]) by svr1.postgresql.org (Postfix) with ESMTP id B3A3356393 for ; Thu, 3 Mar 2005 15:28:38 +0000 (GMT) Received: from kingfisher.intern.logi-track.com (pD95DCDF2.dip0.t-ipconnect.de [217.93.205.242]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.logix-tt.com (Postfix) with ESMTP id 34175A8564; Thu, 3 Mar 2005 15:28:44 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by kingfisher.intern.logi-track.com (Postfix) with ESMTP id 310FFAB0F9; Thu, 3 Mar 2005 16:28:40 +0100 (CET) Message-ID: <42272D27.4030900@logix-tt.com> Date: Thu, 03 Mar 2005 16:28:39 +0100 From: Markus Schaber User-Agent: Mozilla Thunderbird 1.0 (X11/20050116) X-Accept-Language: de-DE, de, en-us, en MIME-Version: 1.0 To: "Casey T. Deccio" Cc: pgsql-sql@postgresql.org Subject: Re: Building a database from a flat file References: <1109808921.12430.75.camel@boomerang.ran.sandia.gov> In-Reply-To: <1109808921.12430.75.camel@boomerang.ran.sandia.gov> X-Enigmail-Version: 0.90.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.05 tagged_above=0 required=5 tests=FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200503/46 X-Sequence-Number: 20525 Hi, Casey, Casey T. Deccio schrieb: > There is more than one problem with this, but the largest is that I > would like to perform this whole database rebuild within one > transaction, so other processes that need to access the database can do > so without noticing the disturbance. However, performing this set of > events (besides populating the temporary table) within a single > transaction takes a long time--over an hour in some cases. > > What are some suggestions to help improve performance with replacing one > set of data in a schema with another? - Create the new date in another schema, and then simply rename those two schemas for "switch over" - Create the new data in differently named tables, and then simply rename all the old and new tables for "switch over". - Have two different set of tables (maybe two identical schemas), and let your application work on a set of views. Then you can change the views via "create or replace view" for switch over. Markus -- Markus Schaber | Dipl. Informatiker | Software Development GIS Fight against software patents in EU! http://ffii.org/ http://nosoftwarepatents.org/