pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Richard Huxton <dev@archonet.com>
To: Brian Choate <brianc@nimblefish.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Poor performance of delete by primary key
Date: Tue, 06 Sep 2005 16:51:05 +0100
Message-ID: <431DBAE9.3060205@archonet.com> (raw)
In-Reply-To: <2F9239F5E316C54688FDA9814FF045D6EADACC@EXCHANGE.sf.nimblefish.com>
References: <2F9239F5E316C54688FDA9814FF045D6EADACC@EXCHANGE.sf.nimblefish.com>

Brian Choate wrote:
> Hello,
> 
> We are seeing a very strange behavior from postgres. For one of our
> very common tasks we have to delete records from a table of around
> 500,000 rows. The delete is by id which is the primary key. It seems
> to be consistently taking around 10 minutes to preform. This is
> totally out of line with the rest of the performance of the database.

> Any ideas on what might be going on?

Well, it sounds like *something* isn't using an index. You say that all 
your FK's are indexed, but that's something worth checking. Also keep an 
eye out for type conflicts.

If the system is otherwise idle, it might be worthwhile to compare 
before and after values of pg_stat* (user-tables and user-indexes).

--
   Richard Huxton
   Archonet Ltd



view thread (8+ messages)  latest in thread

Message-ID: <431DBAE9.3060205@archonet.com>
Permalink:  ../431DBAE9.3060205@archonet.com/
Also on:    postgresql.org/message-id/431DBAE9.3060205@archonet.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: dev@archonet.com, brianc@nimblefish.com
  Subject: Re: Poor performance of delete by primary key
  In-Reply-To: <431DBAE9.3060205@archonet.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox