Re: JDBC speed question.

From: Doug McNaught <doug(at)wireboard(dot)com>
To: "John Oakes" <john(at)networkproductions(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: JDBC speed question.
Date: 2001-04-26 22:35:39
Message-ID: m3pudzuw5g.fsf@belphigor.mcnaught.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-sql

"John Oakes" <john(at)networkproductions(dot)net> writes:

> Anyone have any ideas how to speed up performance using the JDBC driver? A
> query that takes me 20 seconds to execute from command line takes 1 full
> minute with the jdbc driver. Thanks.

Since you don't guve any details of your query or network setup, it's
hard to help much. What could account for the difference, assuming
that the query is exactly the same in both cases, is that the JDBC
driver connects through TCP/IP (even when on the same host) whereas
'psql' will by default connect through a Unix socket. On most
systems, Unix sockets are considerably faster than even local TCP
sockets. If the JDBC client is running on a different machine, the
difference becomes even more pronounced.

This is assuming that your query is returning a great deal of data, so
the network pipe is a factor in the execution time. If it isn't, then
it's unclear how to help you without more details on your table
layouts and the query itself.

-Doug
--
The rain man gave me two cures; he said jump right in,
The first was Texas medicine--the second was just railroad gin,
And like a fool I mixed them, and it strangled up my mind,
Now people just get uglier, and I got no sense of time... --Dylan

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Sterling 2001-04-26 22:54:47 SQL Where Like - Range it?!
Previous Message Tom Lane 2001-04-26 22:24:10 Re: status after 7.1 and pgcrypto update / crypt(table.field) ?

Browse pgsql-sql by date

  From Date Subject
Next Message Clayton Vernon 2001-04-26 23:16:02 Re: JDBC speed question.
Previous Message Tom Lane 2001-04-26 22:15:15 Re: No JOINs in UPDATE ... FROM?