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: Date Fields

Re: Date Fields

From: OraSaurus <granaman_at_not_home.com>
Date: Wed, 13 Oct 1999 03:37:26 GMT
Message-ID: <W7TM3.1282$ry3.17764@news.rdc1.ne.home.com>


In article <7tt45e$3cm$1_at_nnrp1.deja.com>, amerar_at_ci.chi.il.us wrote:
>
>
>Hello,
>
>I have a question about date fields. We have a report that uses the
>date fields in the where clause. So, we created an index on this field
>to speed up the query. This works fine if we use a TO_DATE parameter.
>But if we use the TRUNC verb, then it seems like the index is not used
>because it takes forever......
>
>Why is this?

I suspect that the issue is one of using to_date on a variable or literal versus using trunc() on a database column. Something like...

select ... from myTable where trunc(myTable.myDateColumn) = '01-DEC-99';

will force a full table scan since the index on myTable.myDateColumn cannot be used due to the trunc() function.

Received on Tue Oct 12 1999 - 22:37:26 CDT

Original text of this message

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