pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Bendik Rognlien Johansen <bendik.johansen@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: How to speed up delete
Date: Thu, 07 Jul 2005 10:02:25 -0400
Message-ID: <7517.1120744945@sss.pgh.pa.us> (raw)
In-Reply-To: <6F239216-7936-4E62-B708-46DC9171649C@gmail.com>
References: <6F239216-7936-4E62-B708-46DC9171649C@gmail.com>

Bendik Rognlien Johansen <bendik.johansen@gmail.com> writes:
> I am running few of these deletes (could become many more) inside a  
> transaction and each one takes allmost a second to complete.
> Is it because of the foreign key constraint, or is it something else?

You need an index on "original" to support that FK efficiently.  Check
for references from other tables to this one, too.

			regards, tom lane



view thread (4+ messages)  latest in thread

Message-ID: <7517.1120744945@sss.pgh.pa.us>
Permalink:  ../7517.1120744945@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/7517.1120744945@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, bendik.johansen@gmail.com
  Subject: Re: How to speed up delete
  In-Reply-To: <7517.1120744945@sss.pgh.pa.us>

* 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