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. Nasby||Date: 2004-09-30 21:57:37|
|Subject: Re: Reviving Time Travel (was Re: 'TID index')|
|Previous:||From: Tom Lane||Date: 2004-09-30 21:42:27|
|Subject: Idea about fixing the lockfile issues in postgresql.init|
pgsql-jdbc by date
|Next:||From: Johann Robette||Date: 2004-10-01 07:04:37|
|Subject: RE : Remote query very slow|
|Previous:||From: Adriaan Joubert||Date: 2004-09-30 13:28:20|
|Subject: Re: Java app and SPI functions|