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 E81D932A353 for ; Fri, 1 Oct 2004 08:04:05 +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 83013-05 for ; Fri, 1 Oct 2004 07:04:01 +0000 (GMT) Received: from dns.cegetel-passerelle.com (dns.cegetel-passerelle.com [213.223.187.134]) by svr1.postgresql.org (Postfix) with ESMTP id E03DF32A3B7 for ; Fri, 1 Oct 2004 08:04:01 +0100 (BST) Received: from escmail.esc-lille.fr (unknown [213.223.237.160]) by dns.cegetel-passerelle.com (Postfix) with ESMTP id 68D9A2353E for ; Fri, 1 Oct 2004 09:03:59 +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 DE97A67C0E1 for ; Fri, 1 Oct 2004 09:03:01 +0200 (CEST) Received: from Johann ([10.10.1.165]) by srvmail.esc-lille.fr with Microsoft SMTPSVC(5.0.2195.6713); Fri, 1 Oct 2004 09:03:52 +0200 From: "Johann Robette" To: "'Oliver Jowett'" Cc: Subject: RE : Remote query very slow Date: Fri, 1 Oct 2004 09:04:37 +0200 Message-ID: <005401c4a784$e9ee80a0$a5010a0a@Johann> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.2627 Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 In-Reply-To: <415C80C2.4010404@opencloud.com> X-OriginalArrivalTime: 01 Oct 2004 07:03:52.0698 (UTC) FILETIME=[CF333DA0:01C4A784] 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: 200410/1 X-Sequence-Number: 11106 Thanks for your answer. It seems that my problem lie on the not use of Statement.setFetchSize and the use of the heap. In fact, it appears that when I select all the fields, it's very slow but when I select only the PK it's already better. So it seems that the driver is waiting for the whole data and, only then, returns. I should investigate in that way. Last question, I'm using pgAdminIII to perform my queries. I think that I should have the same problem on the server side than on the remote machine as it is using the same driver. Am I wrong on that point? Thanks a lot -----Message d'origine----- De=A0: pgsql-jdbc-owner@postgresql.org [mailto:pgsql-jdbc-owner@postgresql.org] De la part de Oliver Jowett Envoy=E9=A0: jeudi 30 septembre 2004 23:55 =C0=A0: Johann Robette Cc=A0: pgsql-jdbc@postgresql.org Objet=A0: Re: [JDBC] Remote query very slow Johann Robette wrote: > I=92ve installed postgres 7.3.5 on a fedora server. It works fine, at=20 > least on a local basis. I perform an easy select * from a table and I=20 > get the answer in approximatively 1s. >=20 > Now, I used the jdbc driver (jdbc3) for postgres. It connects fine but,=20 > performing the same query, I get the answer in 7s. >=20 > What could be my problem? Is it really a "remote query" problem? Or is it just a difference=20 between using psql and JDBC? How fast is the query if you run it=20 "remotely" via psql? (psql -h server database) GC is the most likely culprit if you are running with default heap=20 settings and a large data set. Without instructions to the contrary=20 (e.g. Statement.setFetchSize) the driver will try to pull the entire=20 resultset into heap before returning from query execution. Try turning=20 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=20 you're using the 7.3-era driver) if you can. The 7.3 server is getting=20 quite old now, and there are a lot of bugfixes in the current driver=20 that aren't in the 7.3 JDBC driver. -O ---------------------------(end of broadcast)--------------------------- TIP 8: explain analyze is your friend