On 26-Feb-07, at 11:12 AM, Gene wrote:
> 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
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
> thanks, G
> ---------------------------(end of
> TIP 3: Have you checked our extensive FAQ?
In response to
pgsql-performance by date
|Next:||From: Mark Stosberg||Date: 2007-02-26 17:32:09|
|Subject: Re: Writting a "search engine" for a pgsql DB|
|Previous:||From: Mark Stosberg||Date: 2007-02-26 17:26:23|
|Subject: Re: low memory usage reported by 'top' indicates poor tuning?|
pgsql-jdbc by date
|Next:||From: Gene||Date: 2007-02-26 17:41:24|
|Subject: Re: does prepareThreshold work? forced to use old driver|
|Previous:||From: Kris Jurka||Date: 2007-02-26 17:20:07|
|Subject: Re: bug with PGXADataSource in JNDI|