Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Strange behaviour of function based index
g.entelmann_at_t-online.de wrote:
> Hello,
>
> I encountered some strange behaviour of a function based index.
>
> The Index: Create Index FooIndex on Footable(Trunc(aDate));
>
> Executing the following query uses the index:
>
> select Count(aDate) from Footable where Trunc(aDate) = Trunc(Sysdate);
>
> But when I use the query without the 'Count', it uses a full table scan.
>
> Can anyone explain this ??
>
>
> Gerrit
Without seeing the SQL, knowing what version, and knowing whether your used DBMS_STATS to create statistics for the CBO? No.
-- Daniel Morgan http://www.outreach.washington.edu/ext/certificates/oad/oad_crs.asp http://www.outreach.washington.edu/ext/certificates/aoa/aoa_crs.asp damorgan_at_x.washington.edu (replace 'x' with a 'u' to reply)Received on Tue Apr 06 2004 - 09:51:46 CDT