X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id F363452923 for ; Thu, 7 Jul 2005 09:55:47 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 95038-09 for ; Thu, 7 Jul 2005 12:55:30 +0000 (GMT) Received: from boutiquenumerique.com (boutiquenumerique.com [82.67.9.10]) by svr1.postgresql.org (Postfix) with ESMTP id DA3D652823 for ; Thu, 7 Jul 2005 09:55:26 -0300 (ADT) Received: (qmail 8571 invoked from network); 7 Jul 2005 14:55:56 +0200 Received: from unknown (HELO localhost) (boutiquenumerique-lists@192.168.0.4) by boutiquenumerique.com with SMTP; 7 Jul 2005 14:55:56 +0200 To: "Bendik Rognlien Johansen" , pgsql-performance@postgresql.org Subject: Re: How to speed up delete References: <6F239216-7936-4E62-B708-46DC9171649C@gmail.com> Message-ID: Date: Thu, 07 Jul 2005 14:55:28 +0200 From: PFC Organization: =?iso-8859-15?Q?La_Boutique_Num=E9rique?= Content-Type: text/plain; format=flowed; delsp=yes; charset=iso-8859-15 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit In-Reply-To: <6F239216-7936-4E62-B708-46DC9171649C@gmail.com> User-Agent: Opera M2/8.0 (Linux, build 1095) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.005 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200507/65 X-Sequence-Number: 13306 On Thu, 07 Jul 2005 13:16:30 +0200, Bendik Rognlien Johansen wrote: > Hello, > I was wondering if there is any way to speed up deletes on this table > (see details below)? > I am running few of these deletes (could become many more) inside a > transaction and each one takes allmost a second to complete. > Is it because of the foreign key constraint, or is it something else? > > Thanks! Check your references : on delete, pg needs to find which rows to cascade-delete, or set null, or restrict, in the tables which reference this one. Also if this table references another I think it will lookup it too. Do you have indexes for all this ?