Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 0263E6342F5; Mon, 9 Mar 2009 14:45:38 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 57541-07; Mon, 9 Mar 2009 14:45:33 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from milkno.com (pfeiffer02.nmmn.net [217.114.78.33]) by mail.postgresql.org (Postfix) with ESMTP id EFC02633AD7; Mon, 9 Mar 2009 14:42:30 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by milkno.com (Postfix) with ESMTP id 2E56415CC0B0; Mon, 9 Mar 2009 18:42:10 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at milkno.com Received: from milkno.com ([127.0.0.1]) by localhost (localhost [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id oi90ikcHkPHR; Mon, 9 Mar 2009 18:42:09 +0100 (CET) Received: from duke-mac.local (p54AB86CC.dip0.t-ipconnect.de [84.171.134.204]) by milkno.com (Postfix) with ESMTPA id AF5CA15CC0AA; Mon, 9 Mar 2009 18:42:08 +0100 (CET) Message-ID: <49B554F8.7090603@netzmeister-st-pauli.de> Date: Mon, 09 Mar 2009 18:42:16 +0100 From: Andreas Wenk User-Agent: Thunderbird 2.0.0.19 (Macintosh/20081209) MIME-Version: 1.0 To: Tom Lane CC: Guillaume Smet , Guillaume Cottenceau , Mario Splivalo , pgsql-performance@postgresql.org, pgsql-jdbc@postgresql.org Subject: Re: [PERFORM] Query much slower when run from postgres function References: <49B51B60.6030600@megafon.hr> <27649.1236616294@sss.pgh.pa.us> <87fxhmmygj.fsf@meuh.mnc.lan> <1d4e0c10903091004m758d7ea2s91e33631be81215a@mail.gmail.com> <5165.1236618994@sss.pgh.pa.us> In-Reply-To: <5165.1236618994@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200903/31 X-Sequence-Number: 19361 Tom Lane schrieb: > Guillaume Smet writes: >> Unnamed prepared statements are planned after binding the values, >> starting with 8.3, or more precisely starting with 8.3.2 as early 8.3 >> versions were partially broken on this behalf. > > No, 8.2 did it too (otherwise we wouldn't have considered 8.3.0 to be > broken...). The thing I'm not too clear about is what "use of an > unnamed statement" translates to for a JDBC user. > > regards, tom lane > I followed another post in the PHP List. Andrew McMillan was talking about his experiences with udf's in Oracle and PG (--> look for subject: Re: [PHP] pl/php for windows). He was writing that, by using udf's, the planner sometimes uses strange and not performant plans. So generally I understood that using udf's is a good idea - compared with the work I have to do when I code that e.g in PHP and also compared to the better resulting performance with udf's. So what is your experience with using udf's (plpgsql)? Is there something like "use it in this case but not in that case"? Your answers are very welcome ... Cheers Andy