Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id A1B0C633A7D for ; Wed, 7 Apr 2010 10:05:59 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 46558-01 for ; Wed, 7 Apr 2010 13:05:40 +0000 (UTC) Received: from news.hub.org (news.hub.org [200.46.204.72]) by mail.postgresql.org (Postfix) with ESMTP id 0B6516336C9 for ; Wed, 7 Apr 2010 10:05:49 -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 o37D5g7i010331 for ; Wed, 7 Apr 2010 10:05:42 -0300 (ADT) (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.14.3/8.14.3/Submit) id o37CnZd9001298 for pgsql-performance@postgresql.org; Wed, 7 Apr 2010 09:49:35 -0300 (ADT) (envelope-from news) From: "Sabin Coanda" X-Newsgroups: pgsql.performance Subject: How check execution plan of a function Date: Wed, 7 Apr 2010 15:47:54 +0300 Organization: Hub.Org Networking Services Lines: 14 Message-ID: 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; Original 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/99 X-Sequence-Number: 38349 Hi there, I have a function which returns setof record based on a specific query. I try to check the execution plan of that query, so I write EXPLAIN ANALYZE before my select, I call the function and I see the result which shows an actual time about 5 seconds. But when I call my function after I remove EXPLAIN ANALYZE it takes more than 300 seconds, and I cancel it. What's happen, or how can I see the function execution plan to optimize it ? TIA, Sabin