Cardinality in Multicolumn Statistics Vs. Compatibility level ...formulas, calculations and examples!
Hi guys, Welcome to this post! We all knows how much statistics are of vital importance for the performances. If SQL Server estimates an incorrect cardinality it will also generate a non-optimal execution plan . For example, we might find a join type not suitable for the number of lines to manage. Used a nested loop join to read a table with millions of rows is like going from one side of the US to the other using a bicycle . I am sure It will take a long time! But the opposite can also happen... If we used a join operator suitable to handle many lines when instead we have few would be like going to find the neighbour by plane . We would use a lot of resources unnecessarily. Today we focus in the case of multicolumn statistics , let’s see how they are calculated and how this calculation has changed during the SQL Server versions and then at the change of compatibility level. I remember we have just talked about this topic here: SQL Server, A little about composite indices and ...