From: Kris Jurka <books@ejurka.com>
To: Simon Riggs <simon@2ndquadrant.com>
Cc: Josh Berkus <josh@agliodbs.com>
Cc: PostgreSQL - JDBC <pgsql-jdbc@postgresql.org>
Subject: Re: JDBC, prepared queries, and partitioning
Date: Wed, 13 Feb 2008 15:43:46 -0500 (EST)
Message-ID: <Pine.BSO.4.64.0802131537500.26092@leary.csoft.net> (raw)
In-Reply-To: <1202934864.16770.486.camel@ebony.site>
References: <200802131005.30553.josh@agliodbs.com>
<Pine.BSO.4.64.0802131348050.27322@leary.csoft.net>
<1202934864.16770.486.camel@ebony.site>
On Wed, 13 Feb 2008, Simon Riggs wrote:
> On Wed, 2008-02-13 at 13:51 -0500, Kris Jurka wrote:
>>
>> Using protocol version 2 will not prepare queries so constraint exclusion
>> can be used. Just append protocolVersion=2 to your URL.
>
> What about the prepare threshold?
>
I'm not sure what your question is, you might be asking:
1) Do I need to be aware of prepare threshold with V2 connections?
No, prepareThreshold only affects V3 protocol connections. Prior to the
8.0 release there was rudimentary support for converting
PreparedStatements to SQL level PREPARE/EXECUTE that worked with V2, but
that was ripped out in the major 8.0 rewrite and V2 always interpolates
parameters into the query and executes it directly.
2) Can't I use prepare threshold with V3 instead of switching to V2 and
achieve the same effect?
No, in V3 all prepared statements are prepared regardless of the
threshold. The difference is in the level of "preparedness" by using
either a named or unnamed statement at the protocol level. See my
previous email for more details on that topic.
Kris Jurka
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: books@ejurka.com, simon@2ndquadrant.com, josh@agliodbs.com
Subject: Re: JDBC, prepared queries, and partitioning
In-Reply-To: <Pine.BSO.4.64.0802131537500.26092@leary.csoft.net>
References: <200802131005.30553.josh@agliodbs.com> <Pine.BSO.4.64.0802131348050.27322@leary.csoft.net> <1202934864.16770.486.camel@ebony.site> <Pine.BSO.4.64.0802131537500.26092@leary.csoft.net>
* 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