Re: avoid prepared statements on complex queries?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: avoid prepared statements on complex queries?
Дата
Msg-id 25036.1321490152@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: avoid prepared statements on complex queries?  (Kris Jurka <books@ejurka.com>)
Ответы Re: avoid prepared statements on complex queries?  (Anish Kejariwal <anishkej@yahoo.com>)
Список pgsql-jdbc
Kris Jurka <books@ejurka.com> writes:
> 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.

BTW, this should be all better in 9.2 ... so if anyone is thinking of
expending lots of effort to fix it on the JDBC side, don't bother.

            regards, tom lane

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

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