pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Csaba Nagy <nagy@ecircle-ag.com>
To: Dave Cramer <pg@fastcrypt.com>
Cc: Postgres JDBC <pgsql-jdbc@postgresql.org>
Subject: Re: Prepared statements, parameters and logging
Date: Mon, 25 Jun 2007 15:34:35 +0200
Message-ID: <1182778475.13328.79.camel@coppola.muc.ecircle.de> (raw)
In-Reply-To: <9537AA08-53BB-434E-9E62-F326AADED792@fastcrypt.com>
References: <1182768449.13328.60.camel@coppola.muc.ecircle.de>
	<6A182763-97EC-43C9-BD13-EE5375A83AC2@fastcrypt.com>
	<1182770018.13328.63.camel@coppola.muc.ecircle.de>
	<C8485EE8-2EA6-4C87-91CB-E5370A3BDC53@fastcrypt.com>
	<1182775348.13328.69.camel@coppola.muc.ecircle.de>
	<9537AA08-53BB-434E-9E62-F326AADED792@fastcrypt.com>

On Mon, 2007-06-25 at 15:11, Dave Cramer wrote:
> I think the text should be specifying that once you exceed  
> preparedThreshold executions the driver uses a named prepared  
> statement, and can re-use it. Otherwise it uses unnamed prepared  
> statements which need to be prepared for each execution.

OK, but I also thought that the value 0 means no reuse at all, i.e. it
should always prepare for each execution... and 1 should mean always
reuse, from the first statement on.

Before I was using prepareThreshold='1', and I was seeing only such
entries in the server log:

duration: 5437.499 ms  statement: EXECUTE <unnamed>  [PREPARE:  SELECT
... ]

Note the <unnamed> in the log entry, it was always there for each
statement.

After setting prepareThreshold='0', I started getting 2 kinds of log
entries, the ones like above, and the likes:

duration: 2200.570 ms  statement: EXECUTE C_220047  [PREPARE:  SELECT
... ]

Note the C_220047, that's what's changed...

I distinctly remember discussing this issue some time ago on this list,
back then I needed the opposite action, to disable the one-time-prepare
by default... now I just need the opposite, to enable it by default even
for repetitive queries... is that possible ?

Cheers,
Csaba.





view thread (12+ messages)  latest in thread

Message-ID: <1182778475.13328.79.camel@coppola.muc.ecircle.de>
Permalink:  ../1182778475.13328.79.camel@coppola.muc.ecircle.de/
Also on:    postgresql.org/message-id/1182778475.13328.79.camel@coppola.muc.ecircle.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: nagy@ecircle-ag.com, pg@fastcrypt.com
  Subject: Re: Prepared statements, parameters and logging
  In-Reply-To: <1182778475.13328.79.camel@coppola.muc.ecircle.de>
  References: <1182768449.13328.60.camel@coppola.muc.ecircle.de> <6A182763-97EC-43C9-BD13-EE5375A83AC2@fastcrypt.com> <1182770018.13328.63.camel@coppola.muc.ecircle.de> <C8485EE8-2EA6-4C87-91CB-E5370A3BDC53@fastcrypt.com> <1182775348.13328.69.camel@coppola.muc.ecircle.de> <9537AA08-53BB-434E-9E62-F326AADED792@fastcrypt.com> <1182778475.13328.79.camel@coppola.muc.ecircle.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox