New blog post:
In which I test if Query Store plan forcing works on queries that use the RECOMPILE hint and run into an interesting scenario with plan forcing and new indexes.
#sqlserver #sqldba #microsoftsqlserver #mssqlserver #mssql #mssqldba #sql #querystore
https://vladdba.com/2025/07/18/query-store-plan-forcing-queries-recompile-hint/
Does Query Store plan forcing work on queries using the RECOMPILE hint?

It's 2AM and I'm curious if Query Store plan forcing works on queries that use the RECOMPILE hint (aka OPTION(RECOMPILE) ).

VladDBA
Does anybody know how long it takes on Azure SQL Database for the FORCE LAST GOOD PLAN to kick in? We had a very obvious regression this morning, and it ran in a bad state (causing issues with our system) for about 4 hours, CPU hitting 100% before (an hour later) it started forcing the last good plan. I thought this would happen sooner?
#Azure #AzureSQL #QueryStore #AutomaticPlanCorrection
Standing room only at the #sqlbits session by @erinstellato on #querystore.

PSA: If the devs or you are still using
IF EXISTS()
DROP PROCEDURE

CREATE PROC

and you have Query Store enabled where this is executing, then the objectid/queryid is changing for the proc every time this is ran. This means it becomes harder to track a proc in Query Store over time.

#sqlserver #querystore