Understanding the need for lightweight profiling
If you are asking yourself why you would want to know about an obscure Database Engine component named Query Profiling Infrastructure, then read on. Not many database professionals know it by name, but most have dealt with it when they need to troubleshoot query performance issues in a production environment. When a SQL Server performance issue occurs, one of the first requirements is to understand which queries are being executed and how system resources are being used, and one of the most important artifacts anyone can use to find out more about queries that are executing is query plans.
Analyzing a query plan, also known as an estimated execution plan, means that we’re only looking at what SQL Server estimated should be a good-enough plan to return the intended results efficiently. But since an estimated plan is missing runtime data for analysis, it can’t truly provide a conclusive explanation for many query performance...