X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id B864A9F9C9E for ; Sun, 14 May 2006 23:51:06 -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 90443-02 for ; Sun, 14 May 2006 23:51:02 -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 1E3079F946D for ; Sun, 14 May 2006 23:51:01 -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 k4F2oooX021806; Sun, 14 May 2006 22:50:50 -0400 (EDT) To: Enzo Daddario cc: PGADMIN Subject: Re: Constraint question In-reply-to: <1147659556.29084.26.camel@localhost.localdomain> References: <1147659556.29084.26.camel@localhost.localdomain> Comments: In-reply-to Enzo Daddario message dated "Mon, 15 May 2006 10:19:16 +0800" Date: Sun, 14 May 2006 22:50:50 -0400 Message-ID: <21805.1147661450@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200605/172 X-Sequence-Number: 21704 Enzo Daddario writes: > I am now required the remove thousands of obsolete records from table > "X" and even though I have removed all related rows in all related > tables, the deletion of rows in table "X" is taking WAY TOO LONG. You need to put indexes on the referencing columns. Then start a fresh session for doing the actual deletes (FK check plans are usually cached per-session). regards, tom lane