Re: Slow delete - Mailing list pgsql-novice

From Sean Davis
Subject Re: Slow delete
Date
Msg-id 861A38F1-4840-11D9-937A-000D933565E8@mail.nih.gov
Whole thread Raw
In response to Slow delete  ("Colin Gillespie" <C.Gillespie@newcastle.ac.uk>)
List pgsql-novice
Colin,

I'm not sure, but if the larger table could be clustered by the foreign
key index, would that speed things up?  This only works if clustering
makes any sense for the table.  See this link for clustering
(http://www.postgresql.org/docs/7.4/static/sql-cluster.html).  Perhaps
someone else will add some more detailed comments.

Sean

On Dec 7, 2004, at 5:54 AM, Colin Gillespie wrote:

> Dear All,
>
> I have four tables linked together with FK. An example is, deleting an
> id in one table, deletes 1,000,000 rows in all the others. However,
> this operation takes 2-3mins (currently this more or less empties the
> database.) Is this slow?
>
> I have checked that the FK have been indexed and that they have been
> declared intergers. A full vacuum has also been performed.
>
> Does anyone have any suggestions on how to speed this up?
>
> Thanks
>
> Colin
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster


pgsql-novice by date:

Previous
From: "Colin Gillespie"
Date:
Subject: Slow delete
Next
From: Matthew Engelbert
Date:
Subject: Indexing Strategy