Skip site navigation (1) Skip section navigation (2)

Re: JDBC, prepared queries, and partitioning

From: Simon Riggs <simon(at)2ndquadrant(dot)com>
To: Kris Jurka <books(at)ejurka(dot)com>
Cc: Josh Berkus <josh(at)agliodbs(dot)com>, PostgreSQL - JDBC <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: JDBC, prepared queries, and partitioning
Date: 2008-02-13 20:34:24
Message-ID: 1202934864.16770.486.camel@ebony.site (view raw or flat)
Thread:
Lists: pgsql-jdbc
On Wed, 2008-02-13 at 13:51 -0500, Kris Jurka wrote:
> 
> 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.

What about the prepare threshold? 

-- 
  Simon Riggs
  2ndQuadrant  http://www.2ndQuadrant.com 


In response to

Responses

pgsql-jdbc by date

Next:From: Kris JurkaDate: 2008-02-13 20:43:46
Subject: Re: JDBC, prepared queries, and partitioning
Previous:From: Kris JurkaDate: 2008-02-13 19:18:54
Subject: Re: JDBC, prepared queries, and partitioning

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group