> 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.