Re: Optimizing DELETE

Поиск
Список
Период
Сортировка
От Csaba Nagy
Тема Re: Optimizing DELETE
Дата
Msg-id 1158675328.25023.216.camel@coppola.muc.ecircle.de
обсуждение исходный текст
Ответ на Optimizing DELETE  (Ivan Voras <ivoras@fer.hr>)
Список pgsql-performance
> I've just fired off a "DELETE FROM table" command (i.e. unfiltered
> DELETE) on a trivially small table but with many foreign key references
> (on similar-sized tables), and I'm waiting for it to finish. It's been
> 10 minutes now, which seems very excessive for a table of 9000 rows on a
> 3 GHz desktop machine.

If you have missing indexes on the child tables foreign keys, that might
be a cause of slow delete. The cascading delete must look up the to be
deleted rows in all child tables, which will do sequential scans if you
don't have proper indexes.

Try to do an explain analyze for deleting one row, that should also show
you the time spent in triggers, which might clue you in what's taking so
long.

Cheers,
Csaba.



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

Предыдущее
От: "Bucky Jordan"
Дата:
Сообщение: Re: Large tables (was: RAID 0 not as fast as expected)
Следующее
От: Rod Taylor
Дата:
Сообщение: Re: Optimizing DELETE