Estimation, Statistics and “Oh My!”
At the heart of SQL Server is the cost based optimizer. Stop and think about that a minute, it attempts to give the “best plan” based on the cost of the work undertaken. How does it know the cost of the work before its done the work ? This isn’t a conundrum, it doesn’t. It estimates! How does it estimate ? That is statistics.
This will be a deep dive into how the optimizer makes its decisions to give you a plan, the things that can go wrong and how you can have influence over these choices.