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.g.johnston@gmail.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@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-jdbc