X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 05D6811F6280 for ; Tue, 25 Apr 2006 20:09:31 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 50169-10 for ; Tue, 25 Apr 2006 20:09:22 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 91B1311F6282 for ; Tue, 25 Apr 2006 20:09:20 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k3PN9I7q009148; Tue, 25 Apr 2006 19:09:18 -0400 (EDT) To: "Junaili Lie" cc: pgsql-performance@postgresql.org Subject: Re: slow deletes on pgsql 7.4 In-reply-to: <8d04ce990604251441ya85c42evb47946272536cabe@mail.gmail.com> References: <8d04ce990604251441ya85c42evb47946272536cabe@mail.gmail.com> Comments: In-reply-to "Junaili Lie" message dated "Tue, 25 Apr 2006 14:41:03 -0700" Date: Tue, 25 Apr 2006 19:09:18 -0400 Message-ID: <9147.1146006558@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200604/582 X-Sequence-Number: 18666 "Junaili Lie" writes: > we encounter issues when deleting from a table based on id (primary key). O= > n > certain 'id', it took forever to delete and the i/o is 100% busy. Almost always, if delete is slow when selecting the same rows is fast, it's because you've got a trigger performance problem --- most commonly, there are foreign keys referencing this table from other tables and you don't have the referencing columns indexed. regards, tom lane