Discuss Why a certain date makes query faster in the Oracle Development forum on Dev Shed. Why a certain date makes query faster Oracle Development forum discussing administration, Oracle queries, and other Oracle-related topics. Oracle is known as one of the most robust multi-platform relational databases available.
Posts: 14
Time spent in forums: 6 h 52 m 49 sec
Reputation Power: 0
Why a certain date makes query faster
Hello to all.
I have a query with a few tables in join, and I filter data with something like
where mytable.initial_date > sysdate-30
If I use any date, it takes about 5 seconds to run, but if I use
to_date('01010001','ddmmrrrr')
instead of any other dates, it takes just a few milliseconds.
Now, it's just a curiosity, but why that date makes the query VERY fast? Does Oracle treat it in some special way? Maybe it knows every date is greatest than that date and doesn't consider the filter?
Posts: 14
Time spent in forums: 6 h 52 m 49 sec
Reputation Power: 0
The execution plan for both versions is the same, that's why I am confused. The column is not indexed, statistics are up to date and cardinality is the same for both versions of the query.
Posts: 14
Time spent in forums: 6 h 52 m 49 sec
Reputation Power: 0
that's exactly why I opened the thread: I've used two different dates, one is to_date('01010001','ddmmrrrr'), the second one is any other different date.
I know it is odd the execution plan is exactly the same, and that's why it made me curious to know what's behind this different times of execution..