Re: Slow delete

From: Sean Davis <sdavis2(at)mail(dot)nih(dot)gov>
To: "Colin Gillespie" <C(dot)Gillespie(at)newcastle(dot)ac(dot)uk>
Cc: <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Slow delete
Date: 2004-12-07 11:09:54
Message-ID: 861A38F1-4840-11D9-937A-000D933565E8@mail.nih.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

  • Slow delete at 2004-12-07 10:54:41 from Colin Gillespie

Browse pgsql-novice by date

  From Date Subject
Next Message Hari Bhanujan 2004-12-07 15:59:32 Re: message type 0x44
Previous Message Colin Gillespie 2004-12-07 10:54:41 Slow delete