Received: from localhost (unknown [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 4434A9F9A66 for ; Tue, 25 Sep 2007 08:21:56 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 05544-10 for ; Tue, 25 Sep 2007 08:21:52 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from depesz.com (depesz.com [88.198.37.40]) by postgresql.org (Postfix) with ESMTP id 6BF7D9F9A1C for ; Tue, 25 Sep 2007 08:21:52 -0300 (ADT) Received: from depesz by depesz.com with local (Exim 4.63) (envelope-from ) id 1Ia8U9-0005aG-Uc; Tue, 25 Sep 2007 13:21:49 +0200 Date: Tue, 25 Sep 2007 13:21:49 +0200 From: hubert depesz lubaczewski To: Dave Cramer Cc: postgresql performance list Subject: Re: Attempting to disable count triggers on cleanup Message-ID: <20070925112149.GA21433@depesz.com> Reply-To: depesz@depesz.com References: <46F8EC3A.4040607@fastcrypt.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <46F8EC3A.4040607@fastcrypt.com> User-Agent: Mutt/1.5.13 (2006-08-11) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200709/438 X-Sequence-Number: 26983 On Tue, Sep 25, 2007 at 07:08:42AM -0400, Dave Cramer wrote: > ERROR: deadlock detected > DETAIL: Process 23063 waits for ExclusiveLock on tuple (20502,48) of > relation 48999028 of database 14510214; blocked by process 23110. > Process 23110 waits for ShareLock on transaction 1427023217; blocked by > process 23098. > ... > CONTEXT: SQL statement "update user_profile_count set > buddycount=buddycount-1 where user_profile_count.uid= $1 " > PL/pgSQL function "user_buddy_count" line 11 at SQL statement > SQL statement "DELETE FROM ONLY "public"."user_buddies" WHERE > "buddyuserid" = $1" take a look at: http://www.depesz.com/index.php/2007/09/12/objects-in-categories-counters-with-triggers/ and if you want to temporarily disable trigger, simply do appropriate "alter table disable trigger". depesz -- quicksil1er: "postgres is excellent, but like any DB it requires a highly paid DBA. here's my CV!" :) http://www.depesz.com/ - blog dla ciebie (i moje CV)