pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dave Cramer <pg@fastcrypt.com>
To: gene@sotech.us
Cc: pgsql-jdbc@postgresql.org
Cc: pgsql-performance@postgresql.org
Subject: Re: does prepareThreshold work? forced to use old driver
Date: Mon, 26 Feb 2007 12:28:37 -0500
Message-ID: <61223CAE-09EB-4FC0-987D-1542AA0F03F1@fastcrypt.com> (raw)
In-Reply-To: <430d92a20702260812le88fb59w3ec40089db7b54dd@mail.gmail.com>
References: <430d92a20702260812le88fb59w3ec40089db7b54dd@mail.gmail.com>


On 26-Feb-07, at 11:12 AM, Gene wrote:

> hi!
>
> I've been having some serious performance issues with
> postgresql8.2/hibernate/jdbc due to postgres reusing bad cached query
> plans. It doesn't look at the parameter values and therefore does not
> use any partial indexes.
>
> After trying to set prepareThreshold=0 in the connection string which
> didnt work, even modifying the jdbc driver and forcing it to 0 and not
> working I realized that it must be being ignored. After giving up
> pretty much I tried a much older driver which doesn't use server
> prepared statements at all the problem has gone away and it is once
> again using the partial indexes. How can I get this to work properly
> on the new jdbc driver? I don't really like having to use a 2 year old
> driver to get good performance as you can imagine :)
>
> Could someone point me to a jdbc src file where I could just disable
> server-side prepared statements entirely?
>
you can just add protocolVersion=2 to the url and it will not use  
prepared statements.

setting prepareThreshold=0 just tells it not to use named statements.  
It will still use statements but won't cache them.

Are you sure the problem is with cached statements ? There are issues  
where prepared statements won't use the index if you don't use the  
correct type.

Dave
> -- 
> thanks, G
>
> ---------------------------(end of  
> broadcast)---------------------------
> TIP 3: Have you checked our extensive FAQ?
>
>               http://www.postgresql.org/docs/faq
>




view thread (4+ messages)  latest in thread

Message-ID: <61223CAE-09EB-4FC0-987D-1542AA0F03F1@fastcrypt.com>
Permalink:  ../61223CAE-09EB-4FC0-987D-1542AA0F03F1@fastcrypt.com/
Also on:    postgresql.org/message-id/61223CAE-09EB-4FC0-987D-1542AA0F03F1@fastcrypt.com

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: pg@fastcrypt.com, gene@sotech.us, pgsql-jdbc@postgresql.org
  Subject: Re: does prepareThreshold work? forced to use old driver
  In-Reply-To: <61223CAE-09EB-4FC0-987D-1542AA0F03F1@fastcrypt.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