Re: Why is JDBC so slow?

From: Joseph Shraibman <jks(at)selectacast(dot)net>
To: Oliver Jowett <oliver(at)opencloud(dot)com>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Why is JDBC so slow?
Date: 2003-09-02 22:51:27
Message-ID: 3F551EEF.8050109@selectacast.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc


> This can obviously still be improved on, but I think some of the blame for
> slow execution can be pinned on your heap settings not being tuned for the
> object allocation the client does.
>
Interesting. I wouldn't have though that expanding the heap was such a slow operation.

I wrote this test so I could compare JDBC and psql side by side. My real application uses
a cursor and the memory doesn't get so big.

> Incidentally, your use of getFetchSize() to size the return array in
> getResults() seems buggy .. I believe the "correct" way is to do
> ResultSet.last() then ResultSet.getRow().

That's what I used to do, but it makes the code cleaner to use getFetchSize(). Seems to
work all the time for me.

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Andreas Buer 2003-09-03 10:00:26 Writing Binary
Previous Message Oliver Jowett 2003-09-02 22:35:42 Re: Why is JDBC so slow?