Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: sysdate query

Re: sysdate query

From: takesiro <takesiro_at_coral.ocn.ne.jp>
Date: Wed, 10 May 2006 20:09:39 +0900
Message-ID: <e3shlm$1bd$1@news-est.ocn.ad.jp>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US