how to set low_value and high_value using dbms_stats
637538Dec 28 2009 — edited Jan 1 2010Hi ,
i have a table which has a date column that has extreme default values such as 31/12/2999 and 01/01/1900
this cause the CBO th get a wrong assumption about the selectivity and cardinality.
hight balance histogram just made it worst as it think it will get zero rows .
when not using histogram it think it will get less rows but not zero .
when deleting those extreme values the CBO get the righ cardinality.
i want to set the low and high value of the DATE column to more meaningful value so it will get the right selectivity .
method 1:
create another table same as the orig but without the extreme values, collect stats and copy to the orig table.
method 2 :
just set the low and high value of this DATE column.
i tried looking for a way to cast the date to raw and the set the stat but couldn't.
can anyone help ?
thanks