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 29D7E5288B for ; Thu, 7 Jul 2005 12:03:54 -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 24868-07 for ; Thu, 7 Jul 2005 15:03:42 +0000 (GMT) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.195]) by svr1.postgresql.org (Postfix) with ESMTP id 3AC4C52A16 for ; Thu, 7 Jul 2005 12:03:41 -0300 (ADT) Received: by wproxy.gmail.com with SMTP id 70so217248wra for ; Thu, 07 Jul 2005 08:03:40 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:in-reply-to:references:mime-version:content-type:message-id:cc:content-transfer-encoding:from:subject:date:to:x-mailer; b=Y4ZjKsR6QmfKsZc+jKPdd0ZvOMXX6mGyDP9MwsdFeqTDvLRaw4tiz+dn7vl+rVsirkHFgNxYjKpoH5nVgkHaBGbG3D6W5TYU1zbL6TLcYOzjqrOtPqNy1hq3FHuEOK0BReTHsEt8piIKEzqBlz8Z7L5yYW4dbPnK8GE9vnDDC0c= Received: by 10.54.26.4 with SMTP id 4mr832288wrz; Thu, 07 Jul 2005 08:03:40 -0700 (PDT) Received: from ?10.80.1.45? ([194.248.208.82]) by mx.gmail.com with ESMTP id 29sm1727248wrl.2005.07.07.08.03.39; Thu, 07 Jul 2005 08:03:39 -0700 (PDT) In-Reply-To: <7517.1120744945@sss.pgh.pa.us> References: <6F239216-7936-4E62-B708-46DC9171649C@gmail.com> <7517.1120744945@sss.pgh.pa.us> Mime-Version: 1.0 (Apple Message framework v728) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: Cc: Tom Lane Content-Transfer-Encoding: 7bit From: Bendik Rognlien Johansen Subject: Re: How to speed up delete Date: Thu, 7 Jul 2005 17:03:36 +0200 To: pgsql-performance@postgresql.org X-Mailer: Apple Mail (2.728) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.129 tagged_above=0 required=5 tests=AWL, RCVD_BY_IP X-Spam-Level: X-Archive-Number: 200507/75 X-Sequence-Number: 13316 Thanks! That took care of it. On Jul 7, 2005, at 4:02 PM, Tom Lane wrote: > Bendik Rognlien Johansen writes: > >> 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? >> > > You need an index on "original" to support that FK efficiently. Check > for references from other tables to this one, too. > > regards, tom lane >