From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andy <frum@ar-sd.net>
Cc: Steinar H. Gunderson <sgunderson@bigfoot.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Massive delete performance
Date: Tue, 11 Oct 2005 10:17:12 -0400
Message-ID: <13905.1129040232@sss.pgh.pa.us> (raw)
In-Reply-To: <01e401c5ce67$93d65de0$0b00a8c0@forge>
References: <00bd01c5ce37$f8a4cc00$0b00a8c0@forge>
<20051011121942.GA25543@uio.no>
<01e401c5ce67$93d65de0$0b00a8c0@forge>
"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
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, frum@ar-sd.net, sgunderson@bigfoot.com
Subject: Re: Massive delete performance
In-Reply-To: <13905.1129040232@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