Re: avoid prepared statements on complex queries?

Поиск
Список
Период
Сортировка
От Kris Jurka
Тема Re: avoid prepared statements on complex queries?
Дата
Msg-id alpine.BSO.2.00.1111161614110.14447@leary.csoft.net
обсуждение исходный текст
Ответ на Re: avoid prepared statements on complex queries?  (Maciek Sakrejda <msakrejda@truviso.com>)
Ответы Re: avoid prepared statements on complex queries?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-jdbc

On Wed, 16 Nov 2011, Maciek Sakrejda wrote:

> Maybe, although I've never seen that happen and as I understand, the
> driver always sends parameters along with the statement when using
> unnamed statements, so I'm not sure what would trigger this.

The standard example is "WHERE col LIKE ?".  If the parameter is something
like 'abcdef%' then the query can potentially be converted to a range
scan, but only if knows the parameter value.  When preparing this with an
unnamed statement the server has the parameter value, but cannot assume
that the same unnamed statement won't be used with a different parameter
value later and must come up with a plan that is correct for all possible
parameters even if it's not ideal for the current one.

Kris Jurka

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

Предыдущее
От: Maciek Sakrejda
Дата:
Сообщение: Re: avoid prepared statements on complex queries?
Следующее
От: Kris Jurka
Дата:
Сообщение: Re: avoid prepared statements on complex queries?