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 по дате отправления: