Problem Statement
After a version upgrade your critical query regressed. Outline a triage plan to isolate and remediate the issue.
Explanation
Capture before-and-after execution plans and compare join order, operator choices, and estimates. Check if new cardinality models or changed defaults altered heuristics. Verify statistics and compatibility settings; sometimes a minor setting flips behavior.
As a quick mitigation, use plan freezing or hints while you fix root causes. Then make predicates SARGable, add missing indexes, and consider breaking the query into optimized stages. Document the change and add a regression test so future upgrades keep the better plan.
Code Solution
SolutionRead Only
-- SQL Server EXEC sp_create_plan_guide_from_handle @name='freeze_q', @plan_handle=...;
