Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id E02872E0115 for ; Thu, 31 Jan 2008 21:51:00 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 11445-01-9 for ; Thu, 31 Jan 2008 21:50:49 -0400 (AST) Received: from gwmta.wicourts.gov (gwmta.wicourts.gov [165.219.244.99]) by postgresql.org (Postfix) with ESMTP id 3C3FD2E32D1 for ; Thu, 31 Jan 2008 19:06:32 -0400 (AST) Received: from Courts-MTA by gwmta.wicourts.gov with Novell_GroupWise; Thu, 31 Jan 2008 17:06:31 -0600 Message-Id: <47A2000C.EE98.0025.0@wicourts.gov> X-Mailer: Novell GroupWise Internet Agent 7.0.2 Date: Thu, 31 Jan 2008 17:06:20 -0600 From: "Kevin Grittner" To: "Scott Marlowe" , "growse" Cc: Subject: Re: How do I bulk insert to a table without affecting read performance on that table? References: <15099164.post@talk.nabble.com> <15107074.post@talk.nabble.com> In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200801/303 X-Sequence-Number: 28542 >>> On Sat, Jan 26, 2008 at 7:39 AM, in message , "Scott = Marlowe" wrote:=20 > On Jan 26, 2008 5:42 AM, growse wrote: >> Scott Marlowe-2 wrote: >> > Can you import to another table then >> > >> > begin; >> > alter table realtable rename to garbage; >> > alter table loadtable rename to realtable; >> > commit; >> > >> > ? >> >> This is a possibility. My question on this is that would an ALTER TABLE = real >> RENAME TO garbage be faster than a DROP TABLE real? >=20 > I don't know. They're both pretty fast. I'd do a test, with parallel > contention on the table and see. =20 We do something similar (using DROP TABLE) on a weekly cycle. We get occasional errors, even with the database transaction. I wonder whether we might dodge them by using the rename, and then dropping the old table after a brief delay. =20 -Kevin =20