From: Oliver Jowett <oliver@opencloud.com>
To: Csaba Nagy <nagy@ecircle-ag.com>
Cc: Postgres JDBC <pgsql-jdbc@postgresql.org>
Subject: Re: PGStatement#setPrepareThreshold
Date: Thu, 03 Aug 2006 18:05:09 +1200
Message-ID: <44D19215.1070002@opencloud.com> (raw)
In-Reply-To: <1154529173.21451.27.camel@coppola.muc.ecircle.de>
References: <1154529173.21451.27.camel@coppola.muc.ecircle.de>
Csaba Nagy wrote:
> Hi all,
>
> Question: will PGStatement.setPrepareThreshold(1) cause server side
> prepare to be used already on the first execution, or only after the
> second one ?
It should cause it to be used on the first execution (at least that was
the intent)
The logic looks like:
- On statement creation set count=0
- On each execution:
- If this statement is a PreparedStatement, increment count
- If threshold == 0 or count < threshold, make this execution "oneshot"
- Execute query
"oneshot" queries use the unnamed statement (with one exception: queries
that will be backed by a portal use a named statement)
> I couldn't figure out this from the log files... postgres logs the
> queries as <unnamed>, but that doesn't tell me too much.
If you're seeing <unnamed> then those queries aren't using server-side
prepare (the unnamed statement is also special as it's the trigger for
the planner behaviour that you are trying to avoid..) .. so it seems
that you are not managing to trigger server-side prepare for some
reason. Maybe you are using a plain Statement?
-O
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: oliver@opencloud.com, nagy@ecircle-ag.com
Subject: Re: PGStatement#setPrepareThreshold
In-Reply-To: <44D19215.1070002@opencloud.com>
References: <1154529173.21451.27.camel@coppola.muc.ecircle.de> <44D19215.1070002@opencloud.com>
* 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