Skip site navigation (1) Skip section navigation (2)

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: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackerspgsql-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.


In response to


pgsql-hackers by date

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

pgsql-jdbc by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group