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: MarkP28665 <markp28665_at_aol.com>
Date: 1998/03/03
Message-ID: <19980303233600.SAA17961@ladder03.news.aol.com>#1/1

From: Stephan Schaefer <stephan.schaefer_at_camline.com> >> Can I create an index on the date field so that selecting by year that index is used? << This question refers to using on the year portion of the date and the optimizer is choosing a full table scan.

The optimizer choice may be correct for the amount and distribution of data in the table at present. 1) Update the statisitcs on the table and 2) Try using and index hint to see if Oracle will use the index. If the date column is the first column in an index the hint should work.

Good luck testing.

Mark Powell -- Oracle 7 Certified DBA
- The only advice that counts is the advice that you follow so follow your own advice - Received on Tue Mar 03 1998 - 00:00:00 CST

Original text of this message

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