Re: make bulk deletes faster?

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: James Klo <jklo(at)arkitec(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: make bulk deletes faster?
Date: 2005-12-19 02:36:16
Message-ID: 20051219023616.GA89670@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Sat, Dec 17, 2005 at 09:10:40PM -0800, James Klo wrote:
> I'd like some suggestions on how to get the deletes to happen faster, as
> while deleting individually appears to extremely fast, when I go to
> delete lots of rows the operation takes an extremely long time to
> complete (5000 rows takes about 3 minutes, 1000000 rows takes almost
> close to 4 hours or more depending upon server load; wall time btw).

Those times do seem excessive -- do any other tables have foreign
key references to the table you're deleting from? If so, do those
tables have indexes on the referring columns? Does this table or
any referring table have triggers? Also, are you regularly vacuuming
and analyzing your tables? Have you examined pg_locks to see if
an unacquired lock might be slowing things down?

--
Michael Fuhr

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Scott Marlowe 2005-12-19 06:25:18 Re: PostgreSQL and Ultrasparc T1
Previous Message Simon Riggs 2005-12-18 22:28:37 Re: Should Oracle outperform PostgreSQL on a complex