Re: delete is extremely slow

From: "Qingqing Zhou" <zhouqq(at)cs(dot)toronto(dot)edu>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: delete is extremely slow
Date: 2006-05-26 13:56:40
Message-ID: e571es$fv3$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


"Emi Lu" <emilu(at)encs(dot)concordia(dot)ca> wrote
> Hello,
>
> Tried to run:
>
> delete from tableA where id <600000;
>
> It is extremely slow.
>
> id is integer and also the primary key. tableA has around 90000 records.
>
> (I do not want to run truncate since I have some foreign key constraint
> setup based on tableA. Besides not all data I want to delete; only part
> of them).
>

Since you have some FK constrains on A, so delete each line of A will
confirm that it is not depended, which involves a lookup on the dependent
table. Do you have indexes built on these dependents?

Regards,
Qingqing

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Erik Jones 2006-05-26 13:58:47 Re: 8.1.4: Who says "PHP deprecated addslashes since 4.0"?
Previous Message Emi Lu 2006-05-26 13:48:23 delete is extremely slow