X-Original-To: pgsql-admin@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 646CA476B25 for ; Fri, 16 May 2003 14:14:35 -0400 (EDT) Received: from postgresql.org ([64.49.215.8]) by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with ESMTP id 15622-07 for ; Fri, 16 May 2003 14:14:33 -0400 (EDT) Received: from edisonaffiliates.com (w205.z208176060.phx-az.dsl.cnc.net [208.176.60.205]) by postgresql.org (Postfix) with SMTP id 3D326476AB4 for ; Fri, 16 May 2003 14:14:33 -0400 (EDT) Received: from redhen ([12.32.94.66]) by edisonaffiliates.com ; Fri, 16 May 2003 13:07:54 -0500 Reply-To: From: "Marie G. Tuite" To: "Kuhn, Dylan K (4520500D)" , Subject: Re: bulk DELETE speed Date: Fri, 16 May 2003 13:15:54 -0500 Message-ID: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_00C7_01C31BAD.47FA6430" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) In-Reply-To: <78ED1F30F0D85B4698FBD6CF2A5AC8F5A576D4@NAWECHLKEX01VA.nadsuswe.nads.navy.mil> Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-Virus-Scanned: by amavisd-new X-Archive-Number: 200305/245 X-Sequence-Number: 8807 This is a multi-part message in MIME format. ------=_NextPart_000_00C7_01C31BAD.47FA6430 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit bulk DELETE speedIf you can delete all records, try truncating the table: truncate table your_table; This is more efficient and also has the affect of resetting the table. -----Original Message----- From: pgsql-admin-owner@postgresql.org [mailto:pgsql-admin-owner@postgresql.org]On Behalf Of Kuhn, Dylan K (4520500D) Sent: Friday, May 16, 2003 12:15 PM To: pgsql-admin@postgresql.org Subject: [ADMIN] bulk DELETE speed I'm trying to figure out why deletes are slow on a particular table. I have a few tables with millions of rows, and have noticed that deleting rows is many times slower on one of them. It does have PL/PGSQL before and after delete triggers. I've tried disabling the triggers in pg_trigger, dropping them, doing the deletes in transactions, with exclusive locks -- nothing seems to work. Maybe it isn't the triggers at all, and I need to do some sort of analysis on my table to figure out why it is slow? Does anyone have any other tricks for speeding up bulk deletes? Thanks, Dylan Kuhn ------=_NextPart_000_00C7_01C31BAD.47FA6430 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable bulk DELETE speed
If you= =20 can delete all records, try truncating the table:
 
trunca= te table=20 your_table;
 
This i= s more=20 efficient and also has the affect of resetting the table.
-----Original Message-----
From:=20 pgsql-admin-owner@postgresql.org=20 [mailto:pgsql-admin-owner@postgresql.org]On Behalf Of Kuhn, Dylan = K=20 (4520500D)
Sent: Friday, May 16, 2003 12:15 PM
To:=20 pgsql-admin@postgresql.org
Subject: [ADMIN] bulk DELETE=20 speed


I'm trying to figure out why deletes are s= low on a=20 particular table. 

I have a few tables with millions of rows,= and have=20 noticed that deleting rows is many times slower on one of them.  It = does=20 have PL/PGSQL before and after delete triggers.  I've tried disablin= g the=20 triggers in pg_trigger, dropping them, doing the deletes in transactions,= with=20 exclusive locks -- nothing seems to work.  Maybe it isn't the trigge= rs at=20 all, and I need to do some sort of analysis on my table to figure out why= it=20 is slow?

Does anyone have any other tricks for spee= ding up=20 bulk deletes? 

Thanks,
Dylan=20 Kuhn

------=_NextPart_000_00C7_01C31BAD.47FA6430--