pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Giulio Cesare Solaroli <giulio.cesare@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-performance@postgresql.org
Subject: Re: Finalizing commit taking very long
Date: Wed, 24 Oct 2007 15:37:07 +0200
Message-ID: <ff737ac30710240637m39fb0063m466074623d682c38@mail.gmail.com> (raw)
In-Reply-To: <1302.1193231756@sss.pgh.pa.us>
References: <ff737ac30710240344v4391d2eeq957e91dca6c2f9e0@mail.gmail.com>
	<1302.1193231756@sss.pgh.pa.us>

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



view thread (6+ messages)  latest in thread

Message-ID: <ff737ac30710240637m39fb0063m466074623d682c38@mail.gmail.com>
Permalink:  ../ff737ac30710240637m39fb0063m466074623d682c38@mail.gmail.com/
Also on:    postgresql.org/message-id/ff737ac30710240637m39fb0063m466074623d682c38@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: giulio.cesare@gmail.com, tgl@sss.pgh.pa.us
  Subject: Re: Finalizing commit taking very long
  In-Reply-To: <ff737ac30710240637m39fb0063m466074623d682c38@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox