From: Stephan Szabo <sszabo@megazone.bigpanda.com>
To: Chris Kratz <chris.kratz@vistashare.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Delete performance on delete from table with inherited
Date: Tue, 9 Mar 2004 16:18:22 -0800 (PST)
Message-ID: <20040309155908.Y9964@megazone.bigpanda.com> (raw)
In-Reply-To: <200403031649.44937.chris.kratz@vistashare.com>
References: <200403031649.44937.chris.kratz@vistashare.com>
On Wed, 3 Mar 2004, Chris Kratz wrote:
> Which certainly points to the triggers being the culprit. In reading the
> documentation, it seems like the "delete from only..." statement should
> ignore the constraint triggers. But it seems quite obvious from the
Delete from only merely means that children of the table being deleted
will not have their rows checked against any where conditions and removed
for that reason. It does not affect constraint triggers at all.
Given I'm guessing it's going to be running about 7000 * 67 queries to
check the validity of the delete for 7000 rows each having 67 foreign
keys, I'm not sure there's much to do other than hack around the issue
right now.
If you're a superuser, you could temporarily hack reltriggers on the
table's pg_class row to 0, run the delete and then set it back to the
correct number. I'm guessing from your message that there's never any
chance of a concurrent transaction putting in a matching row in a way that
something is marked as deletable when it isn't?
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: sszabo@megazone.bigpanda.com, chris.kratz@vistashare.com
Subject: Re: Delete performance on delete from table with inherited
In-Reply-To: <20040309155908.Y9964@megazone.bigpanda.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