Dear all,
Please find below the 2 queries :
select dep_date from test_date1
where to_char(dep_date,'dd-mon-yyyy') = '12-jan-2002'
select dep_date from test_date1
where TRUNC(dep_date) = to_DATE( '12-jan-2002','dd-mon-yyyy')
The execution plan for both the queries shows a FTS on test_date1.
Execution Plan
----------------------------------------------------------
0 SELECT STATEMENT Optimizer=CHOOSE
1 0 SORT (AGGREGATE)
2 1 TABLE ACCESS (FULL) OF 'TEST_DATE1'
The number of rows to be retrieved are 120010.
The first query took 10msec to execute whereas the second took about 2 secs.
Could anyone help me figure out what the problem would be.
TIA
Best Regards
Jai
- Slow query Roland . Skoldblom
- RE: Slow query Oweson Flynn
- Re: Slow query Peter McLarty
- RE: Slow query Thater, William
- Slow query Roland . Skoldblom
- RE: Slow query JayK
- RE: Slow query Jack van Zanen
- Re: Slow query Jonathan Lewis
- RE: Slow query Stephane Faroult
- RE: Slow query Naveen Nahata
- Re: Slow query Jonathan Lewis
