pg.ddx.io pgsql-jdbc@postgresql.org mailing list archive
help / color / mirror / Atom feedparameterized queries and prepareThreshold
2+ messages / 2 participants
[nested] [flat]
* parameterized queries and prepareThreshold
@ 2007-02-24 20:47 Gene <genekhart@gmail.com>
2007-02-26 23:20 ` Re: parameterized queries and prepareThreshold Oliver Jowett <oliver@opencloud.com>
0 siblings, 1 reply; 2+ messages in thread
From: Gene @ 2007-02-24 20:47 UTC (permalink / raw)
To: pgsql-jdbc
I'm using version 8.2.3 with latest jdbc and noticed that certain
queries take a very
long time even though I have partial indexes that it should be using.
It uses them and performs very quickly if I hard code the constants
(no preparedStmt)
and do an explain.
I noticed this in the changelog and figured it was the problem but
wanted to make sure I wasn't on a wild goose chase:
"Protocol-level unnamed prepared statements are re-planned for each
set of BIND values (Tom) This improves performance because the exact
parameter values can be used in the plan."
I'm using hibernate and can't determine from the docs if what they use
are considered named/unnamed as stated in the docs above but i'm
guessing by the results they are (S_123/C_124).
LOG: duration: 23926.439 ms execute S_123/C_124: select ... PIV1 = ?
OR PIV2 = ? ...
DETAIL: parameters: $1 = 'PARTIALINDEXVALUE1', $2 = 'PARTIALINDEXVALUE2'
In hibernate this is my connection string:
<property name="hibernate.connection.driver_class">org.postgresql.Driver</property>
<property name="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</property>
<property name="hibernate.connection.url">
jdbc:postgresql://192.168.106.191/isis?autoReconnect=true;prepareThreshold=0
</property>
can i verify somehow that the prepareThreshold parameter is making it
into the jdbc driver?
thanks for any help
--
Gene Hart
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: parameterized queries and prepareThreshold
2007-02-24 20:47 parameterized queries and prepareThreshold Gene <genekhart@gmail.com>
@ 2007-02-26 23:20 ` Oliver Jowett <oliver@opencloud.com>
0 siblings, 0 replies; 2+ messages in thread
From: Oliver Jowett @ 2007-02-26 23:20 UTC (permalink / raw)
To: gene@sotech.us; +Cc: pgsql-jdbc
Gene wrote:
> jdbc:postgresql://192.168.106.191/isis?autoReconnect=true;prepareThreshold=0
You need '&' not ';' in that URL.
-O
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2007-02-26 23:20 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2007-02-24 20:47 parameterized queries and prepareThreshold Gene <genekhart@gmail.com>
2007-02-26 23:20 ` Oliver Jowett <oliver@opencloud.com>
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