Re: Prepared statement not using an index

Поиск
Список
Период
Сортировка
От Oliver Jowett
Тема Re: Prepared statement not using an index
Дата
Msg-id 4317863E.8090001@opencloud.com
обсуждение исходный текст
Ответ на Prepared statement not using an index  (Guido Neitzer <guido.neitzer@pharmaline.de>)
Ответы Re: Prepared statement not using an index
Список pgsql-jdbc
Guido Neitzer wrote:

> I have an interesting problem with the JDBC drivers. When I use a
> select like this: [...]

> the existing index on the plz column is not used.
>
> When I the same select with a concrete value, the index IS used.

You should probably ask this on the pgsql-performance list.

> I use PostgreSQL 8.0.3 on Mac OS X and the JDBC driver 8.0-312 JDBC 3.
>
> After a lot of other things, I tried using a 7.4 driver and with  this,
> the index is used in both cases.

The 8.0 drivers pass parameters individually to the backend (analogous
to using PREPARE/EXECUTE), while the 7.4 drivers do textual substitution
into the query text. This can result in different query plans as you've
discovered.

-O

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

Предыдущее
От: "Dave Held"
Дата:
Сообщение: Re: JDBC 8.0-310 + Crystal Reports 10 == Not Implemented
Следующее
От: gurkan@resolution.com
Дата:
Сообщение: ...