Re: Finalizing commit taking very long - Mailing list pgsql-performance

From Giulio Cesare Solaroli
Subject Re: Finalizing commit taking very long
Date
Msg-id ff737ac30710240637m39fb0063m466074623d682c38@mail.gmail.com
Whole thread Raw
In response to Re: Finalizing commit taking very long  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Finalizing commit taking very long
List pgsql-performance
Hello Tom,

On 10/24/07, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> "Giulio Cesare Solaroli" <giulio.cesare@gmail.com> writes:
> > As you may notice, the commit phase takes almost 2 full minutes. :-(
>
> Yow.  It's hard to believe that the actual commit (ie, flushing the
> commit record to WAL) could take more than a fraction of a second.
> I'm thinking there must be a pile of pre-commit work to do, like a
> lot of deferred triggers.  Do you use deferred foreign keys?
> If so, the most likely bet is that the DELETE is triggering a lot
> of deferred FK checks, and these are slow for some reason (maybe
> another missing index).

I have most (if not all) of my constraint defined with the DEFERRABLE
INITIALLY DEFERRED clause.

I have done this as I have not a direct control on the order of the
SQL statements that the Cayenne library sends to the server, and this
will avoid all the constraint violations inside a single transaction.

How can I try to isolate the trigger taking so long, in oder to
understand which is/are the missing index(es)?

Best regards,

Giulio Cesare

pgsql-performance by date:

Previous
From: Gregory Stark
Date:
Subject: Re: multiple apaches against single postgres database
Next
From: Tom Lane
Date:
Subject: Re: Finalizing commit taking very long