ResultSet performance question

Поиск
Список
Период
Сортировка
От Craig Servin
Тема ResultSet performance question
Дата
Msg-id 200812161313.06277.cservin@cromagnon.com
обсуждение исходный текст
Ответы Re: ResultSet performance question  ("Albe Laurenz" <laurenz.albe@wien.gv.at>)
Re: ResultSet performance question  (Andres Ledesma <aledes@euskalnet.net>)
Re: ResultSet performance question  (JAlexoid <jalexoid@gmail.com>)
Список pgsql-jdbc
I'm having a performance issue with Postgresql, but only when using the JDBC
driver.  I'm looking for any suggestions.


I have a very simple query that returns about 7000 rows from a temp table.
Using psql the query returns in under 3 seconds.  Using the JDBC driver it
takes around 30 seconds to run the same query.

I have looked at the query plan using both methods of execution and they are
identical.  I have played around with setFetchSize() and used
con.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
But, since I am trying to get all of the results and it is total runtime I am
worried about server side cursors don't seem applicable.

I have also created a Java class that does nothing but issue rs.next() calls
through the ResultSet to time the execution without any other work being
done.

I can't believe that I am not doing something wrong as the difference in
execution time is extreme.  Is this normal?

Any advice would be greatly appreciated.

Thanks,

Craig


В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Lucas
Дата:
Сообщение: Re: JNDI Tomcat and PostgreSQL Error
Следующее
От: "Albe Laurenz"
Дата:
Сообщение: Re: ResultSet performance question