Re: How can this be?

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: How can this be?
Дата
Msg-id 20050919160622.F99507@megazone.bigpanda.com
обсуждение исходный текст
Ответ на How can this be?  (Martin Nickel <martin@portant.com>)
Список 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 по дате отправления:

Предыдущее
От: Steve Atkins
Дата:
Сообщение: Re: How can this be?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Index Selection: ORDER BY vs. PRIMARY KEY