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

From: Tom Lane
Subject: Re: Simple delete query is taking too long (never ends)
Date: ,
Msg-id: 17089.1447270415@sss.pgh.pa.us
(view: Whole thread, Raw)
In response to: Simple delete query is taking too long (never ends)  (Massalin Yerzhan)
Responses: Re: Simple delete query is taking too long (never ends)  (Merlin Moncure)
List: pgsql-performance

Tree view

Simple delete query is taking too long (never ends)  (Massalin Yerzhan, )
 Re: Simple delete query is taking too long (never ends)  (Tom Lane, )
  Re: Simple delete query is taking too long (never ends)  (Merlin Moncure, )
   Re: Simple delete query is taking too long (never ends)  (Tom Lane, )
   Re: Simple delete query is taking too long (never ends)  (Craig James, )
    Re: Simple delete query is taking too long (never ends)  (Merlin Moncure, )
     Re: Simple delete query is taking too long (never ends)  (Tom Lane, )
      Re: Simple delete query is taking too long (never ends)  (Merlin Moncure, )
       Re: Simple delete query is taking too long (never ends)  (Scott Marlowe, )

Massalin Yerzhan <> 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 by date:

From: Tom Lane
Date:
Subject: Re: Simple delete query is taking too long (never ends)
From: Merlin Moncure
Date:
Subject: Re: Simple delete query is taking too long (never ends)