Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id A28F49FB7FA for ; Wed, 11 Jul 2007 18:54:54 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 09140-04 for ; Wed, 11 Jul 2007 18:54:43 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 0C23A9FB4E1 for ; Wed, 11 Jul 2007 18:54:50 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.1/8.14.1) with ESMTP id l6BLsjmR003562; Wed, 11 Jul 2007 17:54:45 -0400 (EDT) To: Adriaan van Os cc: pgsql-performance@postgresql.org Subject: Re: TRUNCATE TABLE In-reply-to: <46953949.3030201@microbizz.nl> References: <46953949.3030201@microbizz.nl> Comments: In-reply-to Adriaan van Os message dated "Wed, 11 Jul 2007 22:10:49 +0200" Date: Wed, 11 Jul 2007 17:54:45 -0400 Message-ID: <3561.1184190885@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200707/126 X-Sequence-Number: 25810 Adriaan van Os writes: > Surprisingly, one of the bottlenecks is TRUNCATE TABLE and that > command is really slow as compared to other operations. When you don't quantify that statement at all, it's hard to make an intelligent comment on it, but TRUNCATE per se shouldn't be slow. Are you sure you are not measuring a delay to obtain exclusive lock on the table before it can be truncated (ie, waiting for other transactions to finish with it)? regards, tom lane