Database Tuning (MOSC)

MOSC Banner

accurate statistics on skewed foreign key when coming from parent and requesting child details

edited Dec 13, 2011 9:06PM in Database Tuning (MOSC) 7 comments
Hi,

I will be as short as possible:

  • we have two tables in a parent - child relationship. The foreign key is very skewed and we need to get child details coming from the parent
  • CBO is not considering the skeweness from histograms on foreign key column (I suppose it cannot as it is the example without going into tables) and it calculates the expected returning rows in the execution plan as no_rows / distinct_values => 10,000 / 3  = 3,333 rows for both execution plans, even if they returns effectively 1 row / 9,999 rows. In histograms exists this information but it cannot be extracted by CBO as it is.

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center