Re: Remote query very slow

From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: Johann Robette <jrobette(at)onyme(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Remote query very slow
Date: 2004-09-30 21:55:14
Message-ID: 415C80C2.4010404@opencloud.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-jdbc

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim C. Nasby 2004-09-30 21:57:37 Re: Reviving Time Travel (was Re: 'TID index')
Previous Message Tom Lane 2004-09-30 21:42:27 Idea about fixing the lockfile issues in postgresql.init

Browse pgsql-jdbc by date

  From Date Subject
Next Message Johann Robette 2004-10-01 07:04:37 RE : Remote query very slow
Previous Message Adriaan Joubert 2004-09-30 13:28:20 Re: Java app and SPI functions