From: Tom Lane <tgl@sss.pgh.pa.us>
To: Will Reese <wreese@rackspace.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Slow deletes in 8.1 when FKs are involved
Date: Sun, 23 Apr 2006 23:32:39 -0400
Message-ID: <20018.1145849559@sss.pgh.pa.us> (raw)
In-Reply-To: <22780344-3C6A-474E-8101-60B8806DA152@rackspace.com>
References: <22780344-3C6A-474E-8101-60B8806DA152@rackspace.com>
Will Reese <wreese@rackspace.com> writes:
> ... Both servers have identical postgresql.conf settings and were
> restored from the same 7.4 backup. Almost everything is faster on the
> 8.1 server (mostly due to hardware), except one thing...deletes from
> tables with many foreign keys pointing to them.
I think it's unquestionable that you have a bad FK plan in use on the
8.1 server. Double check that you have suitable indexes on the
referencing (not referenced) columns, that you've ANALYZEd all the
tables involved, and that you've started a fresh psql session (remember
the backend tends to cache FK plans for the life of the connection).
It might help to EXPLAIN ANALYZE one of the slow deletes --- 8.1 will
break out the time spent in FK triggers, which would let you see which
one(s) are the culprit.
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, wreese@rackspace.com
Subject: Re: Slow deletes in 8.1 when FKs are involved
In-Reply-To: <20018.1145849559@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