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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Friday 11 September 2009 23:30:37 Robert Haas wrote:
> On Mon, Sep 7, 2009 at 5:05 AM, Vincent de Phily
> <vincent.dephily@xxxxxxxxxxxxxxxxx> 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.dephily@xxxxxxxxxxxxxxxxx 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.

-- 
Sent via pgsql-performance mailing list (pgsql-performance@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance


[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux