Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 667D91337B80 for ; Tue, 7 Dec 2010 11:38:02 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 89608-04-7 for ; Tue, 7 Dec 2010 15:37:54 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id A6DC61337B4F for ; Tue, 7 Dec 2010 11:37:54 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id oB7Fbe9x022560; Tue, 7 Dec 2010 10:37:40 -0500 (EST) To: =?utf-8?b?TWljaGHFgg==?= Roszka cc: Raimon Fernandez , pgsql-general List Subject: Re: SELECT is immediate but the UPDATE takes forever In-reply-to: <20101207154537.81utnyfeo00cwgwg@horde.iq.pl> References: <92781008-8A70-42CE-A49B-6EE67103FACB@montx.com> <20091026231516.GN8812@alvh.no-ip.org> <4AE62E21.7040600@hogranch.com> <66F15D69-75E5-4D8E-84F8-2F21E09BBA98@pgedit.com> <9A9F2678-36B9-42A2-91B2-69076065E8EB@montx.com> <20091027134158.GB4876@alvh.no-ip.org> <4AB34FE9-CC23-48BE-B905-6478304E0E5B@montx.com> <20091027140657.GF4876@alvh.no-ip.org> <4B057205.6000203@gmail.com> <322BBEA5-A328-4197-971E-95359D8FD7F3@montx.com> <4B05A8D4.7020500@gmail.com> <6A231EA8-5255-47F3-BECB-9BFBD700044C@montx.com> <20879F35-6940-4272-988E-703E610C6212@montx.com> <57FE8BF9-5E03-4F5A-9BBA-A06118CC2E3B@pgedit.com> <0AADF4A5-E795-4F2D-AA2B-A4E1A4B! ! D 9D93 @montx.com> Comments: In-reply-to =?utf-8?b?TWljaGHFgg==?= Roszka message dated "Tue, 07 Dec 2010 15:45:37 +0100" Date: Tue, 07 Dec 2010 10:37:40 -0500 Message-ID: <22559.1291736260@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201012/229 X-Sequence-Number: 170520 =?utf-8?b?TWljaGHFgg==?= Roszka writes: > Quoting Raimon Fernandez : >> I want to understand why one of my postgresql functions takes an >> eternity to finish. > Maybe there is any check or constraint on belongs_to_compte_id.comptes that > might take longer? Or maybe the UPDATE is blocked on a lock ... did you look into pg_stat_activity or pg_locks to check? regards, tom lane