From jrobette@onyme.com Thu Sep 30 09:50:51 2004 X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id B835132A3D0 for ; Thu, 30 Sep 2004 10:50:51 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 13837-03 for ; Thu, 30 Sep 2004 09:50:39 +0000 (GMT) Received: from dns.cegetel-passerelle.com (dns.cegetel-passerelle.com [213.223.187.134]) by svr1.postgresql.org (Postfix) with ESMTP id 8B4BE32A3CC for ; Thu, 30 Sep 2004 10:50:39 +0100 (BST) Received: from escmail.esc-lille.fr (unknown [213.223.237.160]) by dns.cegetel-passerelle.com (Postfix) with ESMTP id D2D69235FB for ; Thu, 30 Sep 2004 11:50:37 +0200 (CEST) Received: from srvmail.esc-lille.fr (srvmail.esc-lille.fr [10.1.10.5]) by escmail.esc-lille.fr (Postfix) with ESMTP id 7C09267C023 for ; Thu, 30 Sep 2004 11:49:40 +0200 (CEST) Received: from Johann ([10.10.1.165]) by srvmail.esc-lille.fr with Microsoft SMTPSVC(5.0.2195.6713); Thu, 30 Sep 2004 11:50:30 +0200 From: "Johann Robette" To: Subject: Remote query very slow Date: Thu, 30 Sep 2004 11:50:25 +0200 Message-ID: <003101c4a6d2$ec1971d0$a5010a0a@Johann> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0032_01C4A6E3.AFA241D0" X-Priority: 1 (Highest) X-MSMail-Priority: High X-Mailer: Microsoft Outlook, Build 10.0.2627 Importance: High X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 X-OriginalArrivalTime: 30 Sep 2004 09:50:30.0934 (UTC) FILETIME=[EC333B60:01C4A6D2] X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=1.0 tagged_above=0.0 required=5.0 tests=HTML_MESSAGE, X_MSMAIL_PRIORITY_HIGH, X_PRIORITY_HIGH X-Spam-Level: * X-Archive-Number: 200409/214 X-Sequence-Number: 11104 This is a multi-part message in MIME format. ------=_NextPart_000_0032_01C4A6E3.AFA241D0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hi, I've installed postgres 7.3.5 on a fedora server. It works fine, at least on a local basis. I perform an easy select * from a table and I get the answer in approximatively 1s. Now, I used the jdbc driver (jdbc3) for postgres. It connects fine but, performing the same query, I get the answer in 7s. What could be my problem? Thanks in advance. ------=_NextPart_000_0032_01C4A6E3.AFA241D0 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hi,

 

I’ve installed postgres 7.3.5 on a fedora server. It works fine, at = least on a local basis. I perform an easy select * from a table and I get the ans= wer in approximatively 1s.

Now, I used the jdbc driver (jdbc3) for postgres= . It connects fine but, performing the same query, I get the answer in 7s.

What could be my problem= ?

 =

Thanks in advance.<= /o:p>

------=_NextPart_000_0032_01C4A6E3.AFA241D0-- From oliver@opencloud.com Thu Sep 30 21:55:28 2004 X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 607D832A1D2 for ; Thu, 30 Sep 2004 22:55:28 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 57669-08 for ; Thu, 30 Sep 2004 21:55:22 +0000 (GMT) Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [203.79.85.162]) by svr1.postgresql.org (Postfix) with ESMTP id 556E532A152 for ; Thu, 30 Sep 2004 22:55:22 +0100 (BST) Received: from 203-79-104-60.cable.paradise.net.nz ([203.79.104.60] helo=opencloud.com) by yass.opencloud.co.nz with asmtp (Exim 3.35 #1 (Debian)) id 1CD8tR-00010Y-00; Fri, 01 Oct 2004 09:55:17 +1200 Message-ID: <415C80C2.4010404@opencloud.com> Date: Fri, 01 Oct 2004 09:55:14 +1200 From: Oliver Jowett User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Johann Robette Cc: pgsql-jdbc@postgresql.org Subject: Re: Remote query very slow References: <003101c4a6d2$ec1971d0$a5010a0a@Johann> In-Reply-To: <003101c4a6d2$ec1971d0$a5010a0a@Johann> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200409/215 X-Sequence-Number: 11105 Johann Robette wrote: > I’ve installed postgres 7.3.5 on a fedora server. It works fine, at > least on a local basis. I perform an easy select * from a table and I > get the answer in approximatively 1s. > > Now, I used the jdbc driver (jdbc3) for postgres. It connects fine but, > performing the same query, I get the answer in 7s. > > What could be my problem? Is it really a "remote query" problem? Or is it just a difference between using psql and JDBC? How fast is the query if you run it "remotely" via psql? (psql -h server database) GC is the most likely culprit if you are running with default heap settings and a large data set. Without instructions to the contrary (e.g. Statement.setFetchSize) the driver will try to pull the entire resultset into heap before returning from query execution. Try turning on -verbose:gc on your JVM and see how much time is spent doing GC. You probably want to upgrade both your server and JDBC driver (assuming you're using the 7.3-era driver) if you can. The 7.3 server is getting quite old now, and there are a lot of bugfixes in the current driver that aren't in the 7.3 JDBC driver. -O