Received: from localhost (unknown [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 6B8482E0054 for ; Thu, 13 Dec 2007 19:05:45 -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 61984-03 for ; Thu, 13 Dec 2007 19:05:29 -0400 (AST) Received: from tremor.opencloud.co.nz (tremor.opencloud.co.nz [131.203.101.230]) by postgresql.org (Postfix) with ESMTP id 494032E0052 for ; Thu, 13 Dec 2007 19:05:39 -0400 (AST) Received: from 219-88-219-156.jetstream.xtra.co.nz ([219.88.219.156] helo=[192.168.1.2]) by tremor.opencloud.co.nz with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1J2x7Y-0003Kn-V0; Fri, 14 Dec 2007 12:05:37 +1300 Message-ID: <4761BACA.4020008@opencloud.com> Date: Fri, 14 Dec 2007 12:05:46 +1300 From: Oliver Jowett User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: Tom Duffey CC: pgsql-jdbc@postgresql.org Subject: Re: Slow query after upgrades References: <3EB52707-C945-43D6-9B3F-15F3B228D6F6@techbydesign.com> <4761A221.80604@opencloud.com> <1d4e0c10712131358m4bbc3f57t7e33c6c8ad2b3710@mail.gmail.com> <435EC9B4-F3DD-4136-9070-93E0DBB94B3F@techbydesign.com> <1d4e0c10712131452l65841793r449eb3c7cffbf3a5@mail.gmail.com> <0116C2A9-8DB5-4EBE-A66B-BE7F2A11651C@techbydesign.com> In-Reply-To: <0116C2A9-8DB5-4EBE-A66B-BE7F2A11651C@techbydesign.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200712/101 X-Sequence-Number: 17956 Tom Duffey wrote: > This makes a huge difference, thanks. However, is there anything I can > do to help improve the performance of that query when using a newer > protocol? We need to work out what is going wrong under the newer protocol first, which unfortunately can be a bit tricky because psql doesn't use the query protocol in the same way as the JDBC driver. Can you write a little JDBC app that runs the query with EXPLAIN ANALYZE, setting parameters in the same way that your real app does, and dump out the resultset it gets back? (which should be the EXPLAIN results rather than the real data, IIRC) -O