accurate statistics on skewed foreign key when coming from parent and requesting child details
Hi,
I will be as short as possible:
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.
0