Received: from bjke.com (firewall-user@ganymede.bjke.com [144.210.8.38]) by hub.org (8.9.1/8.9.1) with ESMTP id NAA19445 for ; Thu, 5 Nov 1998 13:42:16 -0500 (EST) (envelope-from djackson@cpsgroup.com) Received: by bjke.com; id MAA00165; Thu, 5 Nov 1998 12:42:11 -0600 (CST) Received: from cpsmail.cpsgroup.com(144.210.12.11) by gauntlet.bjke.com via smap (4.1) id xmaa29079; Thu, 5 Nov 98 12:41:21 -0600 Received: by cpsmail with Internet Mail Service (5.0.1458.49) id ; Thu, 5 Nov 1998 12:43:32 -0600 Message-ID: From: "Jackson, DeJuan" To: Barracuda , pgsql-sql@postgreSQL.org Subject: RE: [SQL] Updating database Date: Thu, 5 Nov 1998 12:43:31 -0600 X-Priority: 3 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.0.1458.49) Content-Type: text/plain > Please help:) > > We have a knowledge base that needs updated every night from a large > text file. Currently a script deletes everything from a table and > adds the new data. This procedure seems to slowly cause the database > to loose performance daily. It also leaves our database useless for > several hours starting at midnight. I thought about using 2 > databases, updating one while using the other, then swapping them > every day. I also thought about having one db.out, then the other in. > > Is there a better way to do this? > > Thanks in advance. > > Charles Day > Why don't you just use another table to COPY the data into. Then at the end of the copy either LOCK, DELETE FROM, INSERT INTO, then VACUUM ANALYZE or DROP, ALTER to rename the copy, recreate INDEXES, then VACUUM ANALYZE I'd do a time test to see which uses the least amount of time. Enjoy, -DEJ > _________________________________________________________ > DO YOU YAHOO!? > Get your free @yahoo.com address at http://mail.yahoo.com >