Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: sysdate query
Hi!
I think roy's idea is correct.
When Function compares in WHERE, It doesn't work with INDEX.
For Example.
A) - SELECT col FROM tbl WHERE SIGN(col) = -1
B) - SELECT col FROM tbl WHERE col < 0
B can use INDEX, A cannot.
This TRUC(sysdate) is function. So it is unable to use INDEX. But when -0, it will probably be DATE(because VCHAR - VCHAR is impossible) Therefore it will work CBT.
Regards.
"roy" <roy.schultheiss_at_t-online.de> wrote in message
news:1147211041.569653.156120_at_i39g2000cwa.googlegroups.com...
> Dears.
>
> Sysdate is not a literal, it is a function. The sysdate function is
> executed for every row, you compare sysdate with a value of a column.
> So I think the optimizer will interpret TRUNC(sysdate) -0 as a literal.
>
> roy
>
Received on Wed May 10 2006 - 06:09:39 CDT
![]() |
![]() |