> Hi.
> In some cases, the Oracle driver seems to instantiate a java.util.Calendar for
> every call to setTimestamp().
>>Hi.
>>In some cases, the Oracle driver seems to instantiate a java.util.Calendar
[quoted text clipped - 5 lines]
> But instantiating java.util.Calendar wouldn't be the cause of the delay
> of 10 seconds :-(
Right, sorry. I didn't look at the code well enough.
Does the table you're querying have an index on start_date?
I guess it does, and the table is big. I am guessing that
the DBMS is *not* using the index when a parameter value
is sent. This may be because the DBMS is receiving the
timestamp values in some way that requires it to convert
the table data to compare it. Because the table data is
converted, the index order cannot be guaranteed, so the
table skips the index. If you can use the DBMS's performance
tools to find out how the query plan differs, that will probably
show the issue. I would post this in the oracle dbms group too.
Joe Weinstein at BEA
>>>Hello,
>>>
[quoted text clipped - 95 lines]
>>>
>>>Janusz
Marek - 18 Jan 2005 20:48 GMT
I am guessing that
> the DBMS is *not* using the index when a parameter value
> is sent. This may be because the DBMS is receiving the
[quoted text clipped - 5 lines]
> show the issue. I would post this in the oracle dbms group too.
> Joe Weinstein at BEA
Thanks a lot, I will check the query plan tomorrow morning :-)
Janusz
> >>>Hello,
> >>>
[quoted text clipped - 96 lines]
> >>>
> >>>Janusz
Janusz - 18 Jan 2005 20:51 GMT
I am guessing that
> the DBMS is *not* using the index when a parameter value
> is sent. This may be because the DBMS is receiving the
[quoted text clipped - 5 lines]
> show the issue. I would post this in the oracle dbms group too.
> Joe Weinstein at BEA
Thanks a lot, I will check the query plan tomorrow morning
Janusz
Janusz - 19 Jan 2005 10:09 GMT
> I am guessing that
> the DBMS is *not* using the index when a parameter value
[quoted text clipped - 5 lines]
> tools to find out how the query plan differs, that will probably
> show the issue.
Joe, you were perfectly right, I generated the sql execution plan,
when ps.setTimestamp(..) is used - Oracle does not use index which is set on
this DATE field (when query executed through jdbc)
Joe Weinstein - 19 Jan 2005 17:46 GMT
>>I am guessing that
>>the DBMS is *not* using the index when a parameter value
[quoted text clipped - 10 lines]
> when ps.setTimestamp(..) is used - Oracle does not use index which is set on
> this DATE field (when query executed through jdbc)
Glad to help. I would suggest posting your findings to the oracle database newsgroup
and filing a TAR with Oracle if you have a support contract. Please post the plan
you see with the hard-coded date and the plan you see with the parameter.
Good luck,
Joe Weinstein at BEA