Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> sysdate query
I was tuning a query and found some strange behavior based on using
sysdate in the selection criteria.
if I use the criteria
and acctg_date > trunc(sysdate)
it does a full table scan, but if I use the criteria
and acctg_date > trunc(sysdate) -0
it does an index range scan on and index on the acctg_date field.
Both retrieve the same data.
The second one performs much better at 14 seconds compared to 6 minutes.
Can anyone tell me why adding the "-0" would change the access path?
This is a 9.2.07 database running on Solaris. Received on Tue May 09 2006 - 09:08:14 CDT