Re: Prepare Statement

From: Kris Jurka <books(at)ejurka(dot)com>
To: Jie Liang <jie(at)stbernard(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-sql(at)postgresql(dot)org, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Prepare Statement
Date: 2004-06-17 18:59:28
Message-ID: Pine.BSO.4.56.0406171356320.14006@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc pgsql-sql

On Thu, 17 Jun 2004, Jie Liang wrote:

> Kirs,
>
> I re-compile with setUseServerPrepare(true), it works fine, thanks.
> However, reading from my log file, what I saw is that five same SELECTs
> with different argument, so I am wondering that the PrepareStatement
> really save time than individualy execute five SELECTs ???
>

This is what I see in the log file:

2004-06-17 11:55:35 [23254] LOG: statement: PREPARE JDBC_STATEMENT_1(integer) AS SELECT $1 ; EXECUTE JDBC_STATEMENT_1(1)
2004-06-17 11:55:35 [23254] LOG: statement: EXECUTE JDBC_STATEMENT_1(2)
2004-06-17 11:55:35 [23254] LOG: statement: EXECUTE JDBC_STATEMENT_1(3)
2004-06-17 11:55:35 [23254] LOG: statement: EXECUTE JDBC_STATEMENT_1(4)
2004-06-17 11:55:35 [23254] LOG: statement: EXECUTE JDBC_STATEMENT_1(5)
2004-06-17 11:55:35 [23254] LOG: statement: DEALLOCATE JDBC_STATEMENT_1

I don't know why this would be different for you. What exact version of
the server and driver are you using?

Kris Jurka

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Kris Jurka 2004-06-17 19:11:57 Re: ResultSet.updateCharacterStream
Previous Message Jie Liang 2004-06-17 18:18:56 Re: Prepare Statement

Browse pgsql-sql by date

  From Date Subject
Next Message InterZone 2004-06-17 19:06:09 Re: Optimal query suggestion needed
Previous Message Jie Liang 2004-06-17 18:18:56 Re: Prepare Statement