Compare top N per group with ROW_NUMBER, APPLY and a correlated subquery, define tie behavior, and measure plans with a supporting index.
Live Execution Plan of a Running Query: SQL in Sixty Seconds #073
A live execution plan shows how far a query has gotten while it is still running. This post builds a slow query on SQL Server 2025, watches it through sys.dm_exec_query_profiles from a second window, and explains why rows divided by the estimate is a progress meter only when the estimate is right.
Cardinality Estimation and Performance: SQL in Sixty Seconds #072
Cardinality estimation and performance depend on each other: the optimizer guesses a row count, and that guess picks the plan and sets the reads. This post tests one query under the old and the new estimator on SQL Server 2025, shows where the new guess wins and where it loses, and explains how to switch estimators with the smallest possible change.
New Cardinality Estimation: What Changed Since 2014
The new cardinality estimation guesses row counts differently from the old one. This post tests both on SQL Server 2025 with one query, shows three switches that choose the model, and gives a safe way to upgrade.
CE Feedback for Expressions in SQL Server 2025
Inspect CE feedback for expressions in SQL Server 2025, check compatibility and Query Store, and observe repeated execution evidence.
Scalar UDF Inlining: When Old Functions Suddenly Get Fast
Check scalar UDF inlining eligibility, database settings, function options, and execution plans before claiming a performance improvement.
Constant Folding: Expressions the Optimizer Solves Before Running
SQL Server does the math on your literals once, while it builds the plan. Here is where that helps, and where it quietly stops.







