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: Smarter way to do that

Re: Smarter way to do that

From: Jim Kennedy <jim>
Date: Fri, 23 Jun 2006 07:04:51 -0700
Message-ID: <Uo-dnVLBTNzBaQbZnZ2dnUVZ_vqdnZ2d@comcast.com>

"ciccio" <ciccio_at_ciccio.it> wrote in message news:449bf31d$1_3_at_x-privat.org...
> Hi
>
> I'd need to select different dates (not times) from a table.
>
> I did a
>
> SELECT DISTINCT TRUNC(MYDATES) FROM MYTABLE
>
> And it gives:
>
> 01/01/2006
> 02/01/2006
> 03/01/2006
>
> and so on as it should, but it is slow, since the table contains a lot
> of records.
>
> It there any smarter and faster way to do that?
>
> TIA
>
> Sandman
>
> Inviato da X-Privat.Org - Registrazione gratuita
http://www.x-privat.org/join.php

You could create a function based index and analyze it

create index mytable_findex on mytable(trunc(mydates)) compute statistics;

Jim Received on Fri Jun 23 2006 - 09:04:51 CDT

Original text of this message

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