Re: prepareThreshold=1 and statement.executeBatch() ??

Поиск
Список
Период
Сортировка
От Joost Kraaijeveld
Тема Re: prepareThreshold=1 and statement.executeBatch() ??
Дата
Msg-id A3D1526C98B7C1409A687E0943EAC410605FA7@obelix.askesis.nl
обсуждение исходный текст
Ответ на prepareThreshold=1 and statement.executeBatch() ??  (Joost Kraaijeveld <J.Kraaijeveld@Askesis.nl>)
Ответы Re: prepareThreshold=1 and statement.executeBatch() ??  (Kris Jurka <books@ejurka.com>)
Список pgsql-jdbc
Hi Kris,

You have tested this with an insert statement. Could you do that also for an update (or try to tell me how I can do
that)?I am getting very strange differences in running time between inserts and update ( 260000 inserts are measured in
seconds,260000 updates over 1 column in the same table are measured in minutes) 

TIA

Groeten,

Joost Kraaijeveld
Askesis B.V.
Molukkenstraat 14
6524NB Nijmegen
tel: 024-3888063 / 06-51855277
fax: 024-3608416
e-mail: J.Kraaijeveld@Askesis.nl
web: www.askesis.nl


> -----Oorspronkelijk bericht-----
> Van: Kris Jurka [mailto:books@ejurka.com]
> Verzonden: zondag 13 november 2005 10:27
> Aan: Joost Kraaijeveld
> CC: pgsql-jdbc@postgresql.org; pgsql-hackers@postgresql.org
> Onderwerp: Re: [JDBC] prepareThreshold=1 and
> statement.executeBatch() ??
>
>
>
>
> On Sun, 13 Nov 2005, Joost Kraaijeveld wrote:
>
> > I have a connection that is created with "prepareThreshold=1" in the
> > connection string. I use a prepared statement that I fill with
> > addbatch() and that I execute with executeBatch() (for full
> source: see
> > "application.java" attachment).
> >
> > LOG:  statement: PREPARE S_2 AS update prototype.customers
> set title=
> > $1 , defaultcurrency=$2, defaulttermsofdelivery=$3 ,
> > defaulttermsofpayment=$4 where customernumber=$5
> > LOG:  statement: <BIND>
> > LOG:  statement: EXECUTE <unnamed>  [PREPARE:  update
> > prototype.customers set title=$1 , defaultcurrency=$2, defaultter
> > msofdelivery=$3, defaulttermsofpayment=$4 where customernumber=$5]
> > LOG:  duration: 773.841 ms
> > LOG:  statement: <BIND>
> > LOG:  statement: EXECUTE <unnamed>  [PREPARE:  update
> > prototype.customers set title=$1 , defaultcurrency=$2, defaultter
> > msofdelivery=$3, defaulttermsofpayment=$4 where customernumber=$5]
> > LOG:  duration: 377.981 ms
> >
> > Does this output mean that the prepared statement with the
> name "S_2" is
> > not used in the following 2 EXECUTE statements and that
> therefor each
> > execute statement is planned again?
> >
>
> No, this actually looks like a bug in the server side
> logging.  The JDBC
> driver issues:
>
> FE=> Parse(stmt=S_1,query="INSERT INTO tt VALUES ($1)",oids={23})
> FE=> Bind(stmt=S_1,portal=null,$1=<1>)
> FE=> Describe(portal=null)
> FE=> Execute(portal=null,limit=1)
> FE=> Bind(stmt=S_1,portal=null,$1=<2>)
> FE=> Describe(portal=null)
> FE=> Execute(portal=null,limit=1)
> FE=> Sync
>
> I assume the server side logging code is getting confused
> because it uses
> a named statement, but the unnamed portal.
>
> Kris Jurka
>
>

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

Предыдущее
От: Kris Jurka
Дата:
Сообщение: Re: prepareThreshold=1 and statement.executeBatch() ??
Следующее
От: Oliver Jowett
Дата:
Сообщение: Re: prepareThreshold=1 and statement.executeBatch() ??