Skip site navigation (1) Skip section navigation (2)

Re: long deletes :( Pls help

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Noel <noel(dot)faux(at)med(dot)monash(dot)edu(dot)au>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: long deletes :( Pls help
Date: 2004-01-20 02:38:36
Message-ID: 20327.1074566316@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-novice
Noel <noel(dot)faux(at)med(dot)monash(dot)edu(dot)au> writes:
> I'm trying to delete from a table which has 42Mill rows, using a foreign 
> key, which is index.
> The delete has been going three days now :( and is really frustrating.

It sounds like you're getting a really bad plan for the queries
triggered by the foreign key constraints.  One thing to make sure
of is that the datatype of the referenced and referencing columns
are the same in each foreign key relationship.  Also check that the
planner statistics are reasonably up to date (pg_class.relpages and
pg_class.reltuples should be in the vicinity of reality, at least).

			regards, tom lane

In response to

Responses

pgsql-novice by date

Next:From: Tom LaneDate: 2004-01-20 02:48:06
Subject: Re: long deletes :( Pls help
Previous:From: NoelDate: 2004-01-20 01:44:36
Subject: Re: long deletes :( Pls help

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group