Quantcast
Viewing all articles
Browse latest Browse all 3587

Re: statistics and density

If there is a histogram available for only one side of a join clause then the total density of the column will be used. There is no other option. The total density is in essence a consolidation of a columns available histogram. If you have no knowledge of what values are being passed to the inner side of a join then it has to assume it could be any value, therefore total density is as good as it gets.

It won't optimise based on individual values for a join unless of course one or other side also has a search argument. If that's the case then that of course is taken into account via transitive closure.

 

Statistical skew is is merely a consequence and extraction of data skew. If you have a very selective range cell density and a much higher total density then this implies the data is skewed toward certain values. I.e. you have some large weight frequency cells.

This skew can be removed from the perspective of the statistics by running sp_modifystats.

This method was more useful pre version 15. Join histograms on 15 eliminated the need to do this in a lot of circumstances.


Viewing all articles
Browse latest Browse all 3587

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>