Re: slow query : very simple delete, 100% cpu, nearly no disk activity

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: slow query : very simple delete, 100% cpu, nearly no disk activity
Дата
Msg-id 16500.1252286723@sss.pgh.pa.us
обсуждение исходный текст
Ответ на slow query : very simple delete, 100% cpu, nearly no disk activity  (Vincent de Phily <vincent.dephily@mobile-devices.fr>)
Ответы Re: slow query : very simple delete, 100% cpu, nearly no disk activity  (Vincent de Phily <vincent.dephily@mobile-devices.fr>)
Список pgsql-performance
Vincent de Phily <vincent.dephily@mobile-devices.fr> writes:
> I've been running this simple delete since yesterday afternoon :
>> db=# explain delete from message where datetime < '2009-03-03';
>> Seq Scan on message  (cost=0.00..34131.95 rows=133158 width=6)
>> Filter: (datetime < '2009-03-03 00:00:00'::timestamp without time zone)

> There is no index on that column, so a seqscan is fine. But it really
> shouldn't take > 15 hours to delete :

99% of the time, the reason a delete takes way longer than it seems like
it should is trigger firing time.  In particular, foreign key triggers
where you don't have an index on the referencing column.  Are there
any foreign keys linking to this table?

            regards, tom lane

В списке pgsql-performance по дате отправления:

Предыдущее
От: Vincent de Phily
Дата:
Сообщение: slow query : very simple delete, 100% cpu, nearly no disk activity
Следующее
От: Reydan Cankur
Дата:
Сообщение: Using Gprof with Postgresql