Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id BE2429FC2D4 for ; Wed, 24 Oct 2007 10:16:04 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 71721-06 for ; Wed, 24 Oct 2007 10:15:34 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id AC2049FC294 for ; Wed, 24 Oct 2007 10:15:59 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.1/8.14.1) with ESMTP id l9ODFuZp001303; Wed, 24 Oct 2007 09:15:57 -0400 (EDT) To: "Giulio Cesare Solaroli" cc: pgsql-performance@postgresql.org Subject: Re: Finalizing commit taking very long In-reply-to: References: Comments: In-reply-to "Giulio Cesare Solaroli" message dated "Wed, 24 Oct 2007 12:44:35 +0200" Date: Wed, 24 Oct 2007 09:15:56 -0400 Message-ID: <1302.1193231756@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200710/270 X-Sequence-Number: 27292 "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). regards, tom lane