From: Oliver Jowett <oliver@opencloud.com>
To: Johann Robette <jrobette@onyme.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Remote query very slow
Date: Fri, 01 Oct 2004 09:55:14 +1200
Message-ID: <415C80C2.4010404@opencloud.com> (raw)
In-Reply-To: <003101c4a6d2$ec1971d0$a5010a0a@Johann>
References: <003101c4a6d2$ec1971d0$a5010a0a@Johann>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: oliver@opencloud.com, jrobette@onyme.com
Subject: Re: Remote query very slow
In-Reply-To: <415C80C2.4010404@opencloud.com>
References: <003101c4a6d2$ec1971d0$a5010a0a@Johann> <415C80C2.4010404@opencloud.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox