Skip site navigation (1) Skip section navigation (2)

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

From: Vincent de Phily <vincent(dot)dephily(at)mobile-devices(dot)fr>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-performance(at)postgresql(dot)org
Subject: Re: slow query : very simple delete, 100% cpu, nearly no disk activity
Date: 2009-09-21 14:53:49
Message-ID: 200909211653.49782.vincent.dephily@mobile-devices.fr (view raw or flat)
Thread:
Lists: pgsql-performance
On Friday 11 September 2009 23:30:37 Robert Haas wrote:
> On Mon, Sep 7, 2009 at 5:05 AM, Vincent de Phily
> <vincent(dot)dephily(at)mobile-devices(dot)fr> wrote:
> > On Monday 07 September 2009 03:25:23 Tom Lane wrote:
> >>
> >> 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?
> >
> > Yes, but they look fine to me (?). Only one FK references the table; it's
> > an internal reference :
> >
(...)
> I would try EXPLAIN ANALYZE DELETE ... with a query that is modified
> so as to delete only a handful of rows.  That will report the amount
> of time spent in triggers vs. the main query, which will help you
> assess whether your conclusion that the foreign keys are OK is
> correct.

Good idea. I'll try that in a little while and report the result.

-- 
Vincent de Phily
Mobile Devices
+33 (0) 666 301 306
+33 (0) 142 119 325

Warning
This message (and any associated files) is intended only for the use of its
intended recipient and may contain information that is confidential, subject
to copyright or constitutes a trade secret. If you are not the intended
recipient you are hereby notified that any dissemination, copying or
distribution of this message, or files associated with this message, is
strictly prohibited. If you have received this message in error, please
notify us immediately by replying to the message and deleting it from your
computer. Any views or opinions presented are solely those of the author
vincent(dot)dephily(at)mobile-devices(dot)fr and do not necessarily represent those of 
the
company. Although the company has taken reasonable precautions to ensure no
viruses are present in this email, the company cannot accept responsibility
for any loss or damage arising from the use of this email or attachments.

In response to

pgsql-performance by date

Next:From: Merlin MoncureDate: 2009-09-21 15:00:36
Subject: Re: slow query : very simple delete, 100% cpu, nearly no disk activity
Previous:From: Vincent de PhilyDate: 2009-09-21 14:50:23
Subject: Re: slow query : very simple delete, 100% cpu, nearly no disk activity

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group