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: Index on Year of date field

Re: Index on Year of date field

From: Konstantin Kivi <konst_at_sirena.rinet.ru>
Date: 1998/03/06
Message-ID: <EpE03x.1wF.0.debian@sirena.rinet.ru>#1/1

Anne-Marie Ternes <anne-marie.ternes_at_cie.smtp.etat.lu> wrote:
> Stephan Schaefer wrote:
> >
> > I have a table with an index on the date field.
> > And I have a view created by:
> > create view myview
> > as select col1,to_char(date_col,'YYYY') year

                    ^^^^^^^^^^^^^^^^^^^^^^^^^^                        

> Hi,
> an index on a column is only effective, if there are, say, more than
> 20 distinct values in the column. Probably this isn't the case with
> you, so the optimizer prefers to do the full table scan.

Wrong !! In this case the problem is with function applied against indexed column.

Sincerely yours, Konstantin Kivi   Received on Fri Mar 06 1998 - 00:00:00 CST

Original text of this message

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