Re: Simple delete query is taking too long (never ends)

Поиск
Список
Период
Сортировка
От Merlin Moncure
Тема Re: Simple delete query is taking too long (never ends)
Дата
Msg-id CAHyXU0wNYJQwW+m0vP_GaSmY6yh82WxB8+425TziJPVMAu-dVA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Simple delete query is taking too long (never ends)  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Simple delete query is taking too long (never ends)  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Simple delete query is taking too long (never ends)  (Craig James <cjames@emolecules.com>)
Список pgsql-performance
On Wed, Nov 11, 2015 at 1:33 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> 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.

You've answered this question (with the same answer) what feels like a
gazillion times.  I guess the underlying problem is that EXPLAIN is,
uh, not explaining things very well.

merlin


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Simple delete query is taking too long (never ends)
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Simple delete query is taking too long (never ends)