X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id CDC329DC9E3 for ; Fri, 10 Feb 2006 17:03:18 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 07143-10 for ; Fri, 10 Feb 2006 17:03:19 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from cassarossa.samfundet.no (cassarossa.samfundet.no [129.241.93.19]) by postgresql.org (Postfix) with ESMTP id B51709DC86D for ; Fri, 10 Feb 2006 17:03:15 -0400 (AST) Received: from trofast.ipv6.sesse.net ([2001:700:300:dc03:20e:cff:fe36:a766] helo=trofast.sesse.net) by cassarossa.samfundet.no with esmtp (Exim 4.50) id 1F7fQB-0004JX-D0 for pgsql-performance@postgresql.org; Fri, 10 Feb 2006 22:03:15 +0100 Received: from sesse by trofast.sesse.net with local (Exim 3.36 #1 (Debian)) id 1F7fQF-0004nQ-00 for ; Fri, 10 Feb 2006 22:03:19 +0100 Date: Fri, 10 Feb 2006 22:03:19 +0100 From: "Steinar H. Gunderson" To: pgsql-performance@postgresql.org Subject: Re: help required in design of database Message-ID: <20060210210319.GA18407@uio.no> Mail-Followup-To: pgsql-performance@postgresql.org References: <9c89e2490602101220i796e6913pdfa05f40bb894b97@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <9c89e2490602101220i796e6913pdfa05f40bb894b97@mail.gmail.com> X-Operating-System: Linux 2.6.14.3 on a x86_64 X-Message-Flag: Outlook? --> http://www.mozilla.org/products/thunderbird/ User-Agent: Mutt/1.5.11 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.075 required=5 tests=[AWL=0.075] X-Spam-Score: 0.075 X-Spam-Level: X-Archive-Number: 200602/111 X-Sequence-Number: 17097 On Fri, Feb 10, 2006 at 12:20:34PM -0800, david drummard wrote: > 1) create a new table every time a new feed file comes in. Create table with > indexes. Use the copy command to dump the data into the table. > 2) rename the current table to some old table name and rename the new table > to current table name so that applications can access them directly. That sounds like a working plan. > Should i create indexes before or after import ? I need to do this in > shortest period of time so that the data is always uptodate. Note that > incremental updates are not possible since almost every row will be changed > in the new file. You should create indexes after the import. Remember to pump up your memory settings (maintenance_work_mem) if you want this to be quick. /* Steinar */ -- Homepage: http://www.sesse.net/