Re: Cannot Delete

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alex <alex(at)meerkatsoft(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Cannot Delete
Date: 2003-09-18 16:07:17
Message-ID: 29783.1063901237@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Alex <alex(at)meerkatsoft(dot)com> writes:
> hi have a table with 2.5 million records which i try do delete. i have
> several constraints on it too.
> i tried to delete the records using delete but it does not seem to work.
> the delete runs forever. hrs...
> i cannot truncate it as it complains about foreign keys.

It's a good bet that you need to create indexes on the columns that
reference this table via foreign keys. Without such indexes, updates
and deletes on the referenced table will be really slow.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Lamar Owen 2003-09-18 16:11:18 Re: State of Beta 2
Previous Message Tom Lane 2003-09-18 16:04:17 Re: psql and blob