Re: Constraint question - Mailing list pgsql-admin

From Tom Lane
Subject Re: Constraint question
Date
Msg-id 21805.1147661450@sss.pgh.pa.us
Whole thread Raw
In response to Constraint question  (Enzo Daddario <enzo@pienetworks.com>)
Responses Re: Constraint question  ("Jim C. Nasby" <jnasby@pervasive.com>)
List pgsql-admin
Enzo Daddario <enzo@pienetworks.com> 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

pgsql-admin by date:

Previous
From: Enzo Daddario
Date:
Subject: Constraint question
Next
From: "Gourish Singbal"
Date:
Subject: increasing max_fsm_pages.