Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 2751F6326E8 for ; Thu, 8 Apr 2010 03:36:07 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 33376-04 for ; Thu, 8 Apr 2010 06:35:56 +0000 (UTC) Received: from news.hub.org (news.hub.org [200.46.204.72]) by mail.postgresql.org (Postfix) with ESMTP id DA07B63248E for ; Thu, 8 Apr 2010 03:35:56 -0300 (ADT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.14.3/8.14.3) with ESMTP id o386ZsXW017000 for ; Thu, 8 Apr 2010 03:35:54 -0300 (ADT) (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.14.3/8.14.3/Submit) id o386UrAd014505 for pgsql-performance@postgresql.org; Thu, 8 Apr 2010 03:30:53 -0300 (ADT) (envelope-from news) From: "Sabin Coanda" X-Newsgroups: pgsql.performance Subject: Re: How check execution plan of a function Date: Thu, 8 Apr 2010 09:29:07 +0300 Organization: Hub.Org Networking Services Lines: 19 Message-ID: References: X-Complaints-To: usenet@news.hub.org X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5843 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-RFC2646: Format=Flowed; Response To: pgsql-performance@postgresql.org X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=-10 required=5 tests=BAYES_50=0.001 X-Spam-Level: X-Archive-Number: 201004/102 X-Sequence-Number: 38352 Maybe other details about the source of the problem help. The problem occured when I tried to optimize the specified function. It was running in about 3 seconds, and I needed to be faster. I make some changes and I run the well known "CREATE OR REPLACE FUNCTION ..." After that, my function execution took so much time that I had to cancel it. I restored the previous function body, but the problem persisted. I tried to drop it and create again, but no chance to restore the original performance. So I was forced to restore the database from backup. Also I found the problem is reproductible, so a change of function will damage its performance. Can anyone explain what is happen ? How can I found the problem ? TIA, Sabin