Re: Very slow delete.

From: Brock Henry <brock(dot)henry(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Very slow delete.
Date: 2004-10-13 00:13:07
Message-ID: 97b3fe204101217135e3ac77@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi Tom,

Thanks for your help. I checked types and indexes, to no avail. Vacuum
didn't help. but vacuum full did, it's now fast again.

Cheers,

Brock

On Mon, 11 Oct 2004 23:38:49 -0400, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Brock Henry <brock(dot)henry(at)gmail(dot)com> writes:
> > delete from people where id < '2000'
>
> > Index Scan using people_pkey on people (cost=0.00..71.68 rows=2792
> > width=6) (actual time=1.361..5.657 rows=2000 loops=1)
> > Index Cond: (id < 3000)
> > Total runtime: 13.006 ms
> > 3 row(s)
> > Total runtime: 63,869.322 ms
>
> So 13 msec to find the rows to delete, and 63850+ msec in overhead.
> Which is certainly from the foreign keys that reference this table,
> because the referencing tables have to be checked to see if they
> contain copies of the key values being deleted.
>
> You either don't have indexes on the referencing columns, or there
> is a datatype mismatch, or possibly you need to update statistics
> for those tables.
>
> regards, tom lane
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message xiaoling he 2004-10-13 01:09:06 memory leak of PQmakeEmptyPGresult??
Previous Message Gaetano Mendola 2004-10-12 23:23:59 Re: deadlock with vacuum full on 7.4.5