Re: Massive delete performance - Mailing list pgsql-performance

From Tom Lane
Subject Re: Massive delete performance
Date
Msg-id 13905.1129040232@sss.pgh.pa.us
Whole thread Raw
In response to Re: Massive delete performance  ("Andy" <frum@ar-sd.net>)
List pgsql-performance
"Andy" <frum@ar-sd.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

pgsql-performance by date:

Previous
From: Sven Willenberger
Date:
Subject: Re: Performance on SUSE w/ reiserfs
Next
From: Alex Turner
Date:
Subject: Re: Performance on SUSE w/ reiserfs