Received: from localhost (unknown [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 02D7F2E025E for ; Mon, 28 Jan 2008 08:03:00 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 07608-03-6 for ; Mon, 28 Jan 2008 08:02:49 -0400 (AST) Received: from mail-relay.rwa-net.co.uk (mail-relay.rwa-net.co.uk [62.189.139.18]) by postgresql.org (Postfix) with ESMTP id D478C2E01B7 for ; Mon, 28 Jan 2008 08:02:28 -0400 (AST) Received: from saturn.rwa-net.co.uk (saturn.rwa-net.co.uk [62.189.139.33]) by mail-relay.rwa-net.co.uk (Postfix) with ESMTP id 1E1957D6348 for ; Mon, 28 Jan 2008 11:41:29 +0000 (GMT) Received: from [127.0.0.1] by saturn.rwa-net.co.uk (GMS 14.01.3539/NT4698.00.83343e8d) with ESMTP id qddkgaaa for pgsql-performance@postgresql.org; Mon, 28 Jan 2008 12:02:26 +0000 Message-ID: <479DC452.8010400@rwa-net.co.uk> Date: Mon, 28 Jan 2008 12:02:26 +0000 From: Matthew Lunnon Reply-To: mlunnon@rwa-net.co.uk Organization: RWA User-Agent: Thunderbird 1.5.0.13 (Windows/20070809) MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Performance problems inside a stored procedure. Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-AuthenticatedSender: mlunnon@rwa-net.co.uk X-Info: UNKNOWN-USER X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200801/260 X-Sequence-Number: 28499 Hi ms 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? postgres.conf changes. shared_buffers = 500MB work_mem = 10MB maintenance_work_mem = 100MB effective_cache_size = 2048MB default_statistics_target = 1000 Thanks for any help. Regards Matthew.