Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

how to set low_value and high_value using dbms_stats

637538Dec 28 2009 — edited Jan 1 2010
Hi ,

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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 28 2010
Added on Dec 28 2009
7 comments
2,241 views