Test OPTIMIZED_SP_EXECUTESQL in SQL Server 2025, inspect compilation counters and cached plans, and compare a concurrent workload.
The Last Actual Execution Plan: LAST_QUERY_PLAN_STATS in Practice
Capture the last actual execution plan with LAST_QUERY_PLAN_STATS, inspect runtime rows, and understand what cache retention cannot provide.
Plan Cache Duplicates From Whitespace and Case Differences
One extra space or a lowercase keyword gives you a second cached plan. See it in the cache, and learn what actually fixes it.
Why Queries Recompile
Why queries recompile becomes clearer when you capture Extended Events causes and check schema changes, statistics, SET options, and temp tables.
Comparing Session SET Options Between SSMS and the Application
Fast in SSMS, slow in the app? The query may be fine and the connection settings different. Here is how to check, with nothing to set up.
Plan Cache Key Lookups: Finding the Worst Ones With XQuery
Not every key lookup needs fixing. Rank statements by reads, find the lookups with XQuery, then test the smallest index change on one call.
Caching Query Results in the Application
Caching query results in the application can reduce repeated reads when ownership, expiry, invalidation, and memory cost are clear.







