Page 1 of 1

Date parameter causes query to run slowly

Posted: Wed 28 Oct 2009 11:31
by vzczc
Version: 5.25.44.0

Using Direct Mode I am having trouble with certain queries involving date parameters.

SELECT col
FROM tbl
WHERE dateCol>:dateParameter
and dateCol2to_date(:dateParameter, 'yyyymmddhh24miss')
and dateCol2<=to_date(:dateParameter2, 'yyyymmddhh24miss')

What can cause this? Is it a bug or the Oracle instance to blame?

Posted: Wed 28 Oct 2009 15:22
by Shalex
Could you please try the 5.25.49 version? If the problem persists, please send us ( http://www.devart.com/company/contact.html ) a small test project with the DDL/DML script. We will try to reproduce the issue.

Re: Date parameter causes query to run slowly

Posted: Wed 18 Nov 2009 14:20
by rwrife
vzczc wrote: SELECT col
FROM tbl
WHERE dateCol>:dateParameter
and dateCol2<=:dateParameter2
Does the query run slowly when you run it through a query utility (ie Toad)? If so then it could be that the dateCol is needs and index or the query execution plan needs to be updated on the server. If date columns are not indexed in Oracle it'll have to do a full table scan since it doesn't know the min/max date....same thing happens if the execution plan gets out of whack and a record has a value outside of the plan's expected min/max.

Posted: Sun 22 Nov 2009 16:09
by Alladin
Please, make sure that parameters declared are of type OracleDbType.Date