Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 7D63563286E for ; Fri, 26 Mar 2010 09:18:39 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 30561-04 for ; Fri, 26 Mar 2010 12:18:28 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from relay.ptn-ipout02.plus.net (relay.ptn-ipout02.plus.net [212.159.7.36]) by mail.postgresql.org (Postfix) with ESMTP id E956863273B for ; Fri, 26 Mar 2010 09:18:28 -0300 (ADT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvsEAE5DrEtUXeby/2dsb2JhbACbK3O/JYR+BA Received: from relay01.plus.net ([84.93.230.242]) by relay.ptn-ipout02.plus.net with ESMTP; 26 Mar 2010 12:18:26 +0000 Received: from [84.51.143.99] (helo=server3.office.archonet.com) by relay01.plus.net with esmtp (Exim) id 1Nv8Uc-0000Va-5T; Fri, 26 Mar 2010 12:18:26 +0000 Received: from [192.168.1.36] (dell36.office.archonet.com [192.168.1.36]) by server3.office.archonet.com (Postfix) with ESMTPA id DA74A2740E8; Fri, 26 Mar 2010 12:18:25 +0000 (GMT) Message-ID: <4BACA611.8050607@archonet.com> Date: Fri, 26 Mar 2010 12:18:25 +0000 From: Richard Huxton User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9pre) Gecko/20100217 Lightning/1.0b1 Shredder/3.0.3pre MIME-Version: 1.0 To: Eliot Gable CC: Merlin Moncure , pgsql-performance@postgresql.org Subject: Re: Performance Tuning Large PL/PGSQL Stored Procedure References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Plusnet-Relay: 658a514e504470ae97afd20358884708 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: 201003/335 X-Sequence-Number: 38160 On 26/03/10 03:56, Eliot Gable wrote: > > I really am chasing milliseconds here, and I appreciate all your feedback. > You've given me a relatively large number of possible optimizations I can > try out. I will definitely try out the libpqtypes. That sounds like a > promising way to further cut down on execution time. I think most of my > performance penalty is in transfering the results back to the C++ > application. In addition to all of Merlin's good advice, if the client is on a different machine to the server then try sticking wireshark or similar onto the connection. That should make it pretty clear where the main costs are in getting your data back. -- Richard Huxton Archonet Ltd