Re: Constraint question

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Enzo Daddario <enzo(at)pienetworks(dot)com>
Cc: PGADMIN <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Constraint question
Date: 2006-05-15 02:50:50
Message-ID: 21805.1147661450@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Enzo Daddario <enzo(at)pienetworks(dot)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

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Gourish Singbal 2006-05-15 06:48:50 increasing max_fsm_pages.
Previous Message Enzo Daddario 2006-05-15 02:19:16 Constraint question