Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 1BB57650E7F for ; Fri, 4 Jul 2008 07:02:17 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 46605-01 for ; Fri, 4 Jul 2008 07:02:01 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from 42.mail-out.ovh.net (42.mail-out.ovh.net [213.251.189.42]) by postgresql.org (Postfix) with SMTP id 2D1BF650EB0 for ; Fri, 4 Jul 2008 07:02:03 -0300 (ADT) Received: (qmail 26100 invoked by uid 503); 4 Jul 2008 10:01:51 -0000 Received: from gw2.ovh.net (HELO mail194.ha.ovh.net) (213.251.189.202) by 42.mail-out.ovh.net with SMTP; 4 Jul 2008 10:01:51 -0000 Received: from b0.ovh.net (HELO queue-out) (213.186.33.50) by b0.ovh.net with SMTP; 4 Jul 2008 10:02:01 -0000 Received: from par69-8-88-161-102-87.fbx.proxad.net (HELO apollo13.peufeu.com) (88.161.102.87) by ns0.ovh.net with SMTP; 4 Jul 2008 10:01:59 -0000 Date: Fri, 04 Jul 2008 12:11:17 +0200 To: "Jessica Richard" , pgsql-performance@postgresql.org Subject: Re: slow delete From: PFC Content-Type: text/plain; format=flowed; delsp=yes; charset=utf-8 MIME-Version: 1.0 References: <357892.18257.qm@web56412.mail.re3.yahoo.com> Content-Transfer-Encoding: 7bit Message-ID: In-Reply-To: <357892.18257.qm@web56412.mail.re3.yahoo.com> User-Agent: Opera Mail/9.24 (Linux) X-Ovh-Tracer-Id: 17660584465451845290 X-Ovh-Remote: 88.161.102.87 (par69-8-88-161-102-87.fbx.proxad.net) X-Ovh-Local: 213.186.33.20 (ns0.ovh.net) X-Spam-Check: DONE|H 0.5/N X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.627 tagged_above=0 required=5 tests=AWL=0.627 X-Spam-Level: X-Archive-Number: 200807/45 X-Sequence-Number: 30645 > by the way, there is a foreign key on another table that references the > primary key col0 on table test. Is there an index on the referencing field in the other table ? Postgres must find the rows referencing the deleted rows, so if you forget to index the referencing column, this can take forever.