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: Roger Snowden <rsnowden_at_supergeek.com>
Date: 1998/03/04
Message-ID: <01bd4789$8a84e9e0$096fc589@WS1009.labinterlink.com>#1/1

If you really need to index the year, you could create a new column and maintain it from the date column with a trigger (insert, update). The trigger logic would have to strip out the year portion and plop it into the new column.

Bear in mind, however, that you will likely end up with a rather non-selective index and you are probably better off with full table scans anyway. One alternative would be to create a bitmap index on the new "year only" column.

Just some food for thought.

Roger Snowden

> > The explain plan of the statement
> > select *
> > from myview
> > where year = '1997';
> > shows me a full table scan.
> >
> > Can I create an index on the date field so that selecting
> > by year that index is used?
Received on Wed Mar 04 1998 - 00:00:00 CST

Original text of this message

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