Re: Slow statement when using JDBC

From: Lachezar Dobrev <l(dot)dobrev(at)gmail(dot)com>
To: David G Johnston <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: List <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Slow statement when using JDBC
Date: 2014-07-21 08:48:01
Message-ID: CA+xsaB13N+dpr4iO=Kop0qpkLf1DTvtcWfqmkYwMEyMRDrN9eQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

If the prepare phase is what might be the culprit, one might want to
try the JDBC using protocol version 2 and rerun any tests:

jdbc:postgresql//host:port/database?protocolVersion=2

2014-07-21 8:32 GMT+03:00 David G Johnston <david(dot)g(dot)johnston(at)gmail(dot)com>:
> arunkmp wrote
>> i tested same query in php using pear-Db connectivity its nomally 2 times
>> faster than java conntivity.
>>
>> for both my postgresql version 9.1,
>>
>> can anyone explain me why its speeder in php.
>
> Given that the reason for the poor JDBC performance has been explained this
> likely isn't the best list to get answers as to why PHP doesn't seem to
> exhibit the same problem...
>
> It would probably also help to supply actual code since your use of the two
> libraries could be a contributing factor.
>
> And the versions of the drivers would also be good information to supply...
>
> PHP is possibly bypassing the whole "prepare" aspect and simply providing
> what appears to be a prepared statement interface while actually sending
> complete queries, without parameters, to the database. This would explain
> the difference but is truly a guess since I have not used Pear/PHP.
>
> David J.
>
>
>
> --
> View this message in context: http://postgresql.1045698.n5.nabble.com/Slow-statement-when-using-JDBC-tp3368379p5812174.html
> Sent from the PostgreSQL - jdbc mailing list archive at Nabble.com.
>
>
> --
> Sent via pgsql-jdbc mailing list (pgsql-jdbc(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-jdbc

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message vjai.krishnan 2014-07-21 13:04:05 Re: Slow statement when using JDBC
Previous Message Albe Laurenz 2014-07-21 07:52:34 Re: JBDC LDAP support