Re: Very strange performance decrease when reusing a PreparedStatement
| От | Oliver Jowett |
|---|---|
| Тема | Re: Very strange performance decrease when reusing a PreparedStatement |
| Дата | |
| Msg-id | 49F71EDD.2070200@opencloud.com обсуждение исходный текст |
| Ответ на | Very strange performance decrease when reusing a PreparedStatement (Frédérik Bilhaut <frederik.bilhaut@noopsis.fr>) |
| Ответы |
Re: Very strange performance decrease when reusing a PreparedStatement
|
| Список | pgsql-jdbc |
Frédérik Bilhaut wrote: > Hi everybody, > > I am experiencing a *very* strange problem when querying Postgres > through JDBC using PreparedStatements. > > To say it short, for the same SELECT query : > > - when reusing a single PreparedStatement the average response time per > query is 60 milliseconds > > - when creating (and closing) a new PreparedStatement each time, the > average response time drops to only 2 milliseconds ! Try with prepareThreshold=0. Probably, your particular query benefits from re-planning each time with the particular concrete parameter values for each execution. (you can either specify this as a URL parameter, or tweak it on a per-connection or per-statement basis via methods on PGConnection/PGStatement) -O
В списке pgsql-jdbc по дате отправления: