Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id E703E2E0369 for ; Mon, 28 Jan 2008 08:12:35 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 53573-03-2 for ; Mon, 28 Jan 2008 08:12:24 -0400 (AST) Received: from mail01.enterprisedb.com (mail01.enterprisedb.com [63.246.7.168]) by postgresql.org (Postfix) with ESMTP id D27572E2EA4 for ; Mon, 28 Jan 2008 08:06:56 -0400 (AST) thread-index: AchhplgGMENSmX8FSlK3woNj602/ug== Received: from [192.168.1.33] ([81.110.30.24]) by mail01.enterprisedb.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Mon, 28 Jan 2008 07:07:23 -0500 Content-Class: urn:content-classes:message Importance: normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.4133 Message-ID: <479DC558.30409@enterprisedb.com> Date: Mon, 28 Jan 2008 12:06:48 +0000 From: "Heikki Linnakangas" Organization: EnterpriseDB User-Agent: Icedove 1.5.0.14pre (X11/20071020) MIME-Version: 1.0 To: Cc: Subject: Re: Performance problems inside a stored procedure. References: <479DC452.8010400@rwa-net.co.uk> In-Reply-To: <479DC452.8010400@rwa-net.co.uk> Content-Type: text/plain; format=flowed; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 28 Jan 2008 12:07:23.0406 (UTC) FILETIME=[571D42E0:01C861A6] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200801/261 X-Sequence-Number: 28500 Matthew Lunnon wrote: > I have a query which runs pretty quick ( 0.82ms) but when I put it > inside a stored procedure it takes 10 times as long (11.229ms). Is > this what you would expect and is there any way that I can get around > this time delay? It depends. You'll need to show us the function. Also, what version of Postgres are you running? -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com