Re: Simple delete query is taking too long (never ends)
В списке pgsql-performance по дате отправления:
| От | Tom Lane |
|---|---|
| Тема | Re: Simple delete query is taking too long (never ends) |
| Дата | |
| Msg-id | 17089.1447270415@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Simple delete query is taking too long (never ends) (Massalin Yerzhan <yerzhik@gmail.com>) |
| Ответы |
Re: Simple delete query is taking too long (never ends)
|
| Список | pgsql-performance |
Massalin Yerzhan <yerzhik@gmail.com> writes:
> I'm having an issue. The query never ends:
> delete from bb_gamelist_league;
9 times out of 10, the answer to this type of problem is that you have
some table referencing this one by a foreign key, and the referencing
column is not indexed. PG doesn't require such an index, but lack of
one will mean that retail checks or deletions of referencing rows are
really slow.
If you're not sure which table is the problem, try doing an EXPLAIN
ANALYZE of a DELETE that will only remove a few rows. You should
see some time blamed on a trigger associated with the FK constraint.
regards, tom lane
В списке pgsql-performance по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера