From: Simon Riggs <simon@2ndquadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Kris Jurka <books@ejurka.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 21:13:42 +0000
Message-ID: <1202937222.16770.505.camel@ebony.site> (raw)
In-Reply-To: <23221.1202935654@sss.pgh.pa.us>
References: <200802131005.30553.josh@agliodbs.com>
<Pine.BSO.4.64.0802131348050.27322@leary.csoft.net>
<1202934864.16770.486.camel@ebony.site>
<23221.1202935654@sss.pgh.pa.us>
On Wed, 2008-02-13 at 15:47 -0500, Tom Lane wrote:
> Simon Riggs <simon@2ndquadrant.com> writes:
> > 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 suppose this could be implemented with a GUC variable rather than an
> explicit protocol change, but I'm not sure if that'd be a good idea or
> not. It's not entirely clear to me which layers on the client side need
> to be aware of such behavior.
What I liked about prepare threshold was that it gave you the ability to
control the re-optimization.
ISTM we need a way to say "this query's parameters vary wildly at
execution time, so I really need to re-plan it every time". We don't
like hints, but that isn't something the database can easily assess.
I don't really like the idea of an on/off "replan every time switch".
DB2 has that and its a little clunky. I do like the idea of being able
to specify re-plan every time (-1) and prepare always (0) or switch from
re-plan every time to prepare after (N) executions.
Planning with the first set of parameters is OK, but only as long as the
first parameter it receives is a "good" one. There's no way to guarantee
that without jerking around more than I think we should.
We talked about this in 2006 but I think the "Option Node" approach
doesn't really cut it from an application developer perspective.
--
Simon Riggs
2ndQuadrant http://www.2ndQuadrant.com
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: simon@2ndquadrant.com, tgl@sss.pgh.pa.us, books@ejurka.com, josh@agliodbs.com
Subject: Re: JDBC, prepared queries, and partitioning
In-Reply-To: <1202937222.16770.505.camel@ebony.site>
References: <200802131005.30553.josh@agliodbs.com> <Pine.BSO.4.64.0802131348050.27322@leary.csoft.net> <1202934864.16770.486.camel@ebony.site> <23221.1202935654@sss.pgh.pa.us> <1202937222.16770.505.camel@ebony.site>
* 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