Re: Massive delete performance

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Andy" <frum(at)ar-sd(dot)net>
Cc: "Steinar H(dot) Gunderson" <sgunderson(at)bigfoot(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: Massive delete performance
Date: 2005-10-11 14:17:12
Message-ID: 13905.1129040232@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

"Andy" <frum(at)ar-sd(dot)net> writes:
> EXPLAIN ANALYZE
> DELETE FROM report WHERE id_order IN
> ...

> Hash IN Join (cost=3532.83..8182.33 rows=32042 width=6) (actual
> time=923.456..2457.323 rows=59557 loops=1)
> ...
> Total runtime: 456718.658 ms

So the runtime is all in the delete triggers. The usual conclusion from
this is that there is a foreign key column pointing at this table that
does not have an index, or is not the same datatype as the column it
references. Either condition will force a fairly inefficient way of
handling the FK deletion check.

regards, tom lane

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Alex Turner 2005-10-11 14:27:36 Re: Performance on SUSE w/ reiserfs
Previous Message Sven Willenberger 2005-10-11 13:52:30 Re: Performance on SUSE w/ reiserfs