Received: from localhost (unknown [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 480B79FC3CC for ; Wed, 24 Oct 2007 10:37:15 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 77869-02 for ; Wed, 24 Oct 2007 10:37:00 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from wr-out-0506.google.com (wr-out-0506.google.com [64.233.184.238]) by postgresql.org (Postfix) with ESMTP id 238DF9FC3D2 for ; Wed, 24 Oct 2007 10:37:10 -0300 (ADT) Received: by wr-out-0506.google.com with SMTP id 68so178033wri for ; Wed, 24 Oct 2007 06:37:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=s3wcqRjuCkV4GSLPQZc8rCtQJPHj83zP01oOiO1aaSA=; b=FcyE4+vnwuwGqPnKnPh7gMzVHFdbuNHZfq7QgosdA+d3nHBxXtvxvh5Ot4WaR2WykPxZbAb3jwSyV70x/R3oL0J31HFSH+b8X3TKhQ8xRm7m4FxUWG5CbLscMPsIQJfcjCmLWvPr/eUYWXTqSzXqLPUgRje/D3Bf3n+2FtVRpn8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=P0cR2O0UytM9d4nFOwQBq6eDRgnfbggg38PSAexlQXebNfCGUMiHfj8of7e32YQuU28ViHmav6bglJPNVkYYUB1cloMxgN5qQ8OMccimwIkuQc0hYbJXJ4NXT0L1+OYwixUq5MhOq0PgI61BgnUjfY+64fCd6xHm8lnZ7NbfBYs= Received: by 10.142.239.11 with SMTP id m11mr88704wfh.1193233028014; Wed, 24 Oct 2007 06:37:08 -0700 (PDT) Received: by 10.142.203.6 with HTTP; Wed, 24 Oct 2007 06:37:07 -0700 (PDT) Message-ID: Date: Wed, 24 Oct 2007 15:37:07 +0200 From: "Giulio Cesare Solaroli" To: "Tom Lane" Subject: Re: Finalizing commit taking very long Cc: pgsql-performance@postgresql.org In-Reply-To: <1302.1193231756@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <1302.1193231756@sss.pgh.pa.us> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200710/273 X-Sequence-Number: 27295 Hello Tom, On 10/24/07, Tom Lane wrote: > "Giulio Cesare Solaroli" 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