Prepared statement not using index

Поиск
Список
Период
Сортировка
От Guido Neitzer
Тема Prepared statement not using index
Дата
Msg-id 08E57775-5E88-42B0-926D-21CAFB21CF24@pharmaline.de
обсуждение исходный текст
Ответы Re: Prepared statement not using index  (John A Meinel <john@arbash-meinel.com>)
Re: Prepared statement not using index  (Dave Cramer <pg@fastcrypt.com>)
Список pgsql-performance
Hi.

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

"SELECT t0.aktiv, t0.id, t0.ist_teilnehmer, t0.nachname, t0.plz,
t0.vorname FROM public.dga_dienstleister t0 WHERE t0.plz
like ?::varchar(256) ESCAPE '|'" withBindings: 1:"53111"(plz)>

the existing index on the plz column is not used.

When I the same select with a concrete value, the index IS used.

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.

Why can this happen? Is there a setting I might have not seen?
Something I do wrong?

cug

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

Предыдущее
От: Dan Harris
Дата:
Сообщение: Re: Poor performance on HP Package Cluster
Следующее
От: Ron
Дата:
Сообщение: Re: Massive performance issues