Re: Under what circumstances does PreparedStatement use stored plans?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Under what circumstances does PreparedStatement use stored plans?
Дата
Msg-id 25164.1081881760@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Under what circumstances does PreparedStatement use stored plans?  (James Robinson <jlrobins@socialserve.com>)
Ответы Re: Under what circumstances does PreparedStatement use stored
Список pgsql-jdbc
James Robinson <jlrobins@socialserve.com> writes:
> ... I suppose this all assumes that the lookup + maintenance of such a
> datastructure would ultimately cost less than re-planning all queries
> all the time.

I think that is a safe bet to be true, as long as you get *some* mileage
out of the plan cache.  If the application issues a bunch of
no-two-alike queries then it's a loss of course.  But doesn't the JDBC
API distinguish prepared statements from unprepared ones?  ISTM it is
the app programmer's responsibility to prepare just those statements
he's likely to use more than once.  I don't think the driver need
second-guess this choice.

            regards, tom lane

В списке pgsql-jdbc по дате отправления:

Предыдущее
От: James Robinson
Дата:
Сообщение: Re: Under what circumstances does PreparedStatement use stored plans?
Следующее
От: James Robinson
Дата:
Сообщение: Re: Under what circumstances does PreparedStatement use stored plans?