From: Tom Lane <tgl@sss.pgh.pa.us>
To: Mark Lewis <mark.lewis@mir3.com>
Cc: Brian Choate <brianc@nimblefish.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Poor performance of delete by primary key
Date: Tue, 06 Sep 2005 13:42:59 -0400
Message-ID: <19191.1126028579@sss.pgh.pa.us> (raw)
In-Reply-To: <1126026278.3310.76.camel@archimedes>
References: <2F9239F5E316C54688FDA9814FF045D6EADACC@EXCHANGE.sf.nimblefish.com>
<18162.1126020720@sss.pgh.pa.us>
<1126026278.3310.76.camel@archimedes>
Mark Lewis <mark.lewis@mir3.com> writes:
> I had a similar problem, so I downloaded 8.1 from CVS, ran it on a
> relatively gnarly dev workstation, imported a dump of my 8.0 database,
> and ran my troublesome queries with the new EXPLAIN ANALYZE.
> This process took about an hour and worked great, provided that you've
> actually named your foreign key constraints. Otherwise, you'll find out
> that there's a trigger for a constraint called $3 that's taking up all
> of your time, but you won't know what table that constraint is on.
But at least you've got something you can work with. Once you know the
name of the problem trigger you can look in pg_trigger to see which
other table it's connected to. Try something like
select tgname, tgconstrrelid::regclass, tgargs from pg_trigger
where tgrelid = 'mytable'::regclass;
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, mark.lewis@mir3.com, brianc@nimblefish.com
Subject: Re: Poor performance of delete by primary key
In-Reply-To: <19191.1126028579@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