Re: JDBC, prepared queries, and partitioning

Поиск
Список
Период
Сортировка
От Kris Jurka
Тема Re: JDBC, prepared queries, and partitioning
Дата
Msg-id Pine.BSO.4.64.0802131348050.27322@leary.csoft.net
обсуждение исходный текст
Ответ на JDBC, prepared queries, and partitioning  (Josh Berkus <josh@agliodbs.com>)
Ответы Re: JDBC, prepared queries, and partitioning  (Kris Jurka <books@ejurka.com>)
Re: JDBC, prepared queries, and partitioning  (Simon Riggs <simon@2ndquadrant.com>)
Список pgsql-jdbc

On Wed, 13 Feb 2008, Josh Berkus wrote:

> Since JDBC always prepares and plan-caches queries, it makes it hard to use
> partitioning with a database connected to a JDBC connection pool; successive
> queries in the same session will select the wrong partition, or scan the
> whole partition set.
>

It will never scan the wrong partition.  It will always scan all
partitions.  The server is smart enough to not generate a plan that is not
valid for only one parameter set.

Using protocol version 2 will not prepare queries so constraint exclusion
can be used.  Just append protocolVersion=2 to your URL.

Kris Jurka

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

Предыдущее
От: Josh Berkus
Дата:
Сообщение: JDBC, prepared queries, and partitioning
Следующее
От: Kris Jurka
Дата:
Сообщение: Re: JDBC, prepared queries, and partitioning