From: Stephan Szabo <sszabo@megazone.bigpanda.com>
To: Martin Nickel <martin@portant.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: How can this be?
Date: Mon, 19 Sep 2005 16:07:44 -0700 (PDT)
Message-ID: <20050919160622.F99507@megazone.bigpanda.com> (raw)
In-Reply-To: <pan.2005.09.17.01.34.11.467862@portant.com>
References: <pan.2005.09.17.01.34.11.467862@portant.com>
On Fri, 16 Sep 2005, Martin Nickel wrote:
> Hello all,
> Mostly Postgres makes sense to me. But now and then it does something
> that boggles my brain. Take the statements below. I have a table
> (agent) with 5300 rows. The primary key is agent_id. I can do SELECT
> agent_id FROM agent and it returns all PK values in less than half a
> second (dual Opteron box, 4G ram, SATA Raid 10 drive system).
>
> But when I do a DELETE on two rows with an IN statement, using the primary
> key index (as stated by EXPLAIN) it take almost 4 minutes.
> pg_stat_activity shows nine other connections, all idle.
Are there any tables that reference agent or other triggers? My first
guess would be that there's a foreign key check for something else that's
referencing agent.agent_id for which an index scan isn't being used.
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, martin@portant.com
Subject: Re: How can this be?
In-Reply-To: <20050919160622.F99507@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