Re: Slow statement when using JDBC
| От | Kevin Grittner |
|---|---|
| Тема | Re: Slow statement when using JDBC |
| Дата | |
| Msg-id | 4D497D16020000250003A249@gw.wicourts.gov обсуждение исходный текст |
| Ответ на | Slow statement when using JDBC (yazan suleiman <yazan.suleiman@gmail.com>) |
| Ответы |
Re: Slow statement when using JDBC
|
| Список | pgsql-jdbc |
yazan suleiman wrote: > where magnitude.magnitude>=? When you pass a literal there, the planner can get a good estimate of how many rows match that criterion, and give you a good plan based on that. When it must prepare a plan with a parameter there, it must assume that *any* value could be submitted, even one which would require the entire table to be passed. The best plan to use will depend entirely on the actual value, but PostgreSQL currently fixes a single plan when you prepare a statement on the server. For queries like this, you want to be sure that the query is planned each time based on the actual value. -Kevin
В списке pgsql-jdbc по дате отправления: