Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 3150D9FBD18 for ; Thu, 8 Mar 2007 13:49:58 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-new, port 10024) with ESMTP id 22743-01 for ; Thu, 8 Mar 2007 13:49:46 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from mail.metronet.co.uk (mail.metronet.co.uk [213.162.97.75]) by postgresql.org (Postfix) with ESMTP id 1610E9FBCC8 for ; Thu, 8 Mar 2007 13:49:44 -0400 (AST) Received: from server3.office.archonet.com (84-51-143-99.archon037.adsl.metronet.co.uk [84.51.143.99]) by smtp.metronet.co.uk (MetroNet Mail) with ESMTP id 45284769ED; Thu, 8 Mar 2007 17:49:42 +0000 (GMT) Received: from [192.168.1.36] (dell36.office.archonet.com [192.168.1.36]) by server3.office.archonet.com (Postfix) with ESMTP id EECDA27401E; Thu, 8 Mar 2007 17:49:41 +0000 (GMT) Message-ID: <45F04CB5.4060204@archonet.com> Date: Thu, 08 Mar 2007 17:49:41 +0000 From: Richard Huxton User-Agent: IceDove 1.5.0.9 (X11/20061220) MIME-Version: 1.0 To: "Schwarz, Karl" Cc: pgsql-performance@postgresql.org Subject: Re: function performance vs in-line sql References: <9E64800D28DF264DB32B0309B6F222D5188548@xcgny105.northgrum.com> In-Reply-To: <9E64800D28DF264DB32B0309B6F222D5188548@xcgny105.northgrum.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.205 tagged_above=0 required=5 tests=AWL, BAYES_50, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200703/168 X-Sequence-Number: 23573 Schwarz, Karl wrote: > Is there something basic I am missing here with the use of a function. I > am no database expert, but my assumption was that a function would give > me better results than in-line sql. Not necessarily. Usually it means the planner has less information to go on. We'll need more information though - table definitions, queries, how is the function called etc. -- Richard Huxton Archonet Ltd