Re: Prepared statement not using an index

From: Guido Neitzer <guido(dot)neitzer(at)pharmaline(dot)de>
To: Oliver Jowett <oliver(at)opencloud(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Prepared statement not using an index
Date: 2005-09-02 05:49:11
Message-ID: 0C0329E7-1A4B-478C-A003-5C605496FC19@pharmaline.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On 02.09.2005, at 0:52 Uhr, Oliver Jowett wrote:

>> 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.

This sounds like a bug to me. If a simple substitution of the
placeholders with actual values ends with different query plan, my
understanding is, that there is something broken in the query
planner ...

cug

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Martin Taal 2005-09-02 08:44:45 timestamp moves when setting and getting a value from postgresql
Previous Message Joseph Shraibman 2005-09-02 03:38:21 Getting vacuum results