Re: How can this be? - Mailing list pgsql-performance

From Stephan Szabo
Subject Re: How can this be?
Date
Msg-id 20050919160622.F99507@megazone.bigpanda.com
Whole thread Raw
In response to How can this be?  (Martin Nickel <martin@portant.com>)
List pgsql-performance
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.

pgsql-performance by date:

Previous
From: Steve Atkins
Date:
Subject: Re: How can this be?
Next
From: Tom Lane
Date:
Subject: Re: Index Selection: ORDER BY vs. PRIMARY KEY