pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kris Jurka <books@ejurka.com>
To: Josh Berkus <josh@agliodbs.com>
Cc: PostgreSQL - JDBC <pgsql-jdbc@postgresql.org>
Subject: Re: JDBC, prepared queries, and partitioning
Date: Wed, 13 Feb 2008 13:51:24 -0500 (EST)
Message-ID: <Pine.BSO.4.64.0802131348050.27322@leary.csoft.net> (raw)
In-Reply-To: <200802131005.30553.josh@agliodbs.com>
References: <200802131005.30553.josh@agliodbs.com>



On Wed, 13 Feb 2008, Josh Berkus wrote:

> Since JDBC always prepares and plan-caches queries, it makes it hard to use
> partitioning with a database connected to a JDBC connection pool; successive
> queries in the same session will select the wrong partition, or scan the
> whole partition set.
>

It will never scan the wrong partition.  It will always scan all 
partitions.  The server is smart enough to not generate a plan that is not 
valid for only one parameter set.

Using protocol version 2 will not prepare queries so constraint exclusion 
can be used.  Just append protocolVersion=2 to your URL.

Kris Jurka



view thread (41+ messages)  latest in thread

Message-ID: <Pine.BSO.4.64.0802131348050.27322@leary.csoft.net>
Permalink:  ../Pine.BSO.4.64.0802131348050.27322@leary.csoft.net/
Also on:    postgresql.org/message-id/Pine.BSO.4.64.0802131348050.27322@leary.csoft.net

 · 

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: books@ejurka.com, josh@agliodbs.com
  Subject: Re: JDBC, prepared queries, and partitioning
  In-Reply-To: <Pine.BSO.4.64.0802131348050.27322@leary.csoft.net>
  References: <200802131005.30553.josh@agliodbs.com> <Pine.BSO.4.64.0802131348050.27322@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