Re: Impossibly slow DELETEs

From: Neil Conway <neilc(at)samurai(dot)com>
To: schampailler(at)easynet(dot)be
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Impossibly slow DELETEs
Date: 2003-11-25 23:55:33
Message-ID: 87znekuhoq.fsf@mailbox.samurai.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Stefan Champailler <schampailler(at)easynet(dot)be> writes:
> So here's my trouble : some DELETE statement take up to 1 minute to
> complete (but not always, sometimes it's fast, sometimes it's that
> slow). Here's a typical one : DELETE FROM response_bool WHERE
> response_id = '125' The response_bool table has no foreing key and
> no index on response_id column. No foreign key reference the
> response_bool table.

I'm skeptical that PostgreSQL is causing the performance problem
here -- 1 minute for a DELETE on a single-page table is absurdly
slow. If you enable the log_min_duration_statement configuration
variable, you should be able to get an idea of how long it actually
takes PostgreSQL to execute each query -- do you see some 60 second
queries in the log?

What is the system load like when the query takes a long time? For
example, `vmstat 1` output around this point in time would be
helpful.

Does PostgreSQL consume a lot of CPU time or do a lot of disk I/O?

Can you confirm this problem using psql?

> There are 6 rows in the table (given that size, I assumed that an
> index was not necessary).

That's a reasonable assumption.

-Neil

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2003-11-26 00:37:18 Re: Impossibly slow DELETEs
Previous Message Bill Moran 2003-11-25 23:45:08 Re: Impossibly slow DELETEs